--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/a0c2784c-8ddf-485f-8704-4155e1659929%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
package com.testng.examples1;
import static org.testng.Assert.assertEquals;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
public class realexample1 {
public WebDriver driver;
@Test
public void testcase8()
{
assertEquals(true, driver.findElement(By.xpath("//*[text()='Last Name:']")).isDisplayed());
}
@Test
public void testcase9()
{
assertEquals(true, driver.findElement(By.xpath("//*[text()='Company:']")).isDisplayed());
}
@Test
public void testcase10()
{
assertEquals(true, driver.findElement(By.xpath("//*[text()='First Name:']")).isDisplayed());
}
@BeforeMethod
public void login()
{
System.out.println("Login");
//driver.findElement(By.name("user_name")).clear();
driver.findElement(By.name("user_name")).sendKeys("admin");
driver.findElement(By.name("user_password")).sendKeys("admin");
driver.findElement(By.name("Login")).click();
driver.findElement(By.linkText("New Lead")).click();
}
@AfterMethod
public void logout()
{
System.out.println("logout");
driver.findElement(By.linkText("Logout")).click();
}
@BeforeClass
public void LaunchApp()
{
System.out.println("LaunchApp");
System.setProperty("webdriver.chrome.driver", "C:/Selenium/SeleniumSoftware/chromedriver_win32/chromedriver.exe/");
ChromeOptions options = new ChromeOptions();
options.addArguments("--remote-allow-origins=*");
ChromeDriver driver = new ChromeDriver(options);
// driver = new ChromeDriver();
driver.get("http://localhost:100/index.php");
driver.manage().window().maximize();
}
@AfterClass
public void CloseApp()
{
System.out.println("CloseApp");
}
}