Sibling xpath

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class XpathSiblingsParent
{
public static void main(String[] args) throws InterruptedException {
System.setProperty(“webdriver.chrome.driver”,”path”);
WebDriver driver=new ChromeDriver();
driver.manage().window().maximize();
driver.get(“http://www.qaclickacademy.com/interview.php”);
driver.findElement(By.xpath(“//li[@id=’tablist1-tab1′]/following-sibling::li[3]”)).click();
Thread.sleep(1000);
driver.findElement(By.xpath(“//*[text()=’ Selenium ‘]”)).click();
driver.close();
}
}

Leave a comment