October 2018
Intermediate to advanced
192 pages
5h 12m
English
On the http://www.freecrm.com login page, the structure is such that the username, password, and the login button are contained inside the form with id=xyz. In such a situation, the child elements can be accessed using findElements on the container or parent element.
The following code displays the number of input elements in the form:
public class DynamicText1 { public static void main(String[] args) { System.setProperty("webdriver.chrome.driver", "C:\\SeleniumWD\\src\\main\\resources\\chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); driver.get("http://www.freecrm.com"); String dynamicXpath = "//*[@id='loginForm']"; List<WebElement> ...Read now
Unlock full access