New answers tagged

1

The id attribute of the <div> tag is dynamic which will change each time the webpage is accessed. In these cases you need to construct dynamic locator strategies as follows: xpath //div[starts-with(@id, 'post-body-')]/div/form/input Note: The second <div> is the first/only child of it's parent, the <form> is the first/only child of it's ...


0

Please try to this one package com.tests; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.testng.Assert; import org.testng.annotations.Test; public class IfExampleSelenium { @Testpublic void testPageTitle() { System.out.println("Launching Firefox browser.."); WebDriver driver = new FirefoxDriver(); ...


Top 50 recent answers are included