Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save muditlambda/24c4ded1f68b48e62a7e92ff0e7e3bf6 to your computer and use it in GitHub Desktop.
Save muditlambda/24c4ded1f68b48e62a7e92ff0e7e3bf6 to your computer and use it in GitHub Desktop.
@Test
public void test_login_using_relative_locators_3(){
WebElement txt_name = driver.findElement(withTagName("input")
.toLeftOf(By.id("addbutton"))
.below(By.name("li5")));
txt_name.sendKeys("Relative locators test");
// Get details of the Submit/Add button
WebElement submitbutton = driver.findElement(By.xpath("//*[@id=\'addbutton\']"));
// Submit the new entry
submitbutton.click();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment