<code>import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
public class SeleniumBasics {
public static void main(String[] args) {
WebDriver driver= new ChromeDriver();
driver.get("https://formy-project.herokuapp.com/");
driver.manage().window().maximize();
driver.findElement(By.xpath("//body/div[1]/div[1]/li[1]")).click();
}
}
</code>
<code>import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
public class SeleniumBasics {
public static void main(String[] args) {
WebDriver driver= new ChromeDriver();
driver.get("https://formy-project.herokuapp.com/");
driver.manage().window().maximize();
driver.findElement(By.xpath("//body/div[1]/div[1]/li[1]")).click();
}
}
</code>
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
public class SeleniumBasics {
public static void main(String[] args) {
WebDriver driver= new ChromeDriver();
driver.get("https://formy-project.herokuapp.com/");
driver.manage().window().maximize();
driver.findElement(By.xpath("//body/div[1]/div[1]/li[1]")).click();
}
}
Im trying to click on the element “autocomplete” in this page https://formy-project.herokuapp.com/…not working ..any help pleae?
Absolute Xpath
relative Xpath
find by element
New contributor
Kamilia Bouras is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.