Using xPath:
String var = selenium.getAttribute("//input[@name='q']/@maxlength"); System.out.println(var);
Using csslocator:
String var = selenium.getAttribute("css=input[name='q']@maxlength"); System.out.println(var);
Using webdriver:
String var = webDriver.findElement(By.xpath("//input[@name='q']")).getAttribute("maxlength") System.out.println(var);
No comments:
Post a Comment