package esoft;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class esofttest {
public static WebDriver driver;
/// public static JavascriptExecutor js;
@BeforeClass
public void setUp() throws InterruptedException {
//initialization driver set property
// System.setProperty("webdriver.chrome.driver", "/home/hari/Documents/chromedriver_linux64/chromedriver");
System.setProperty("webdriver.chrome.driver", "C:\\Users\\SRIKANTH\\Downloads\\chromedriver_win32 (1) latest\\chromedriver.exe");
//driver = new FirefoxDriver();
driver = new ChromeDriver();
// Launch Website
//Maximize the browser
// driver.manage().window().maximize();
// Launch Website
//Maximize the browser
driver.manage().window().maximize();
Thread.sleep(3000);
String title = driver.getTitle();
System.out.println("Title is " + title);
}
@Test(priority=1, enabled=true)
public void verifybackenddeveloperpage() throws InterruptedException {
Actions actions = new Actions(driver);
WebElement menuHoverLink = driver.findElement(By.linkText("Career"));
actions.moveToElement(menuHoverLink).perform();
WebElement subLink = driver.findElement(By.xpath("//*[@id="post-1719"]/div/div[4]/div/div/div/div/div/div[7]/div/div/div[2]/div/div[2]/a"));
subLink.click();
String title = driver.getTitle();
System.out.println("Title is " + title);
}
@AfterClass
public void setDown() throws InterruptedException {
Thread.sleep(5000);
driver.close();
}
}