标签:int password href 多个 nbsp put exce text webdriver
/*<div id="divId">
<input id="userid" type="text" value="liuhaixia" title="用户名" name="userid" class="uid">
<input id="password" type="password" value="123456" title="密码" name="password">
<a href="http://192.168.66.71:8080/dss" >超链接</a>
</div>*/
//根据tagName定位多个元素
public void locateMoreElements() throws IOException{
System.out.println("---------根据tagName定位多个元素---------");
WebDriver driver = new FirefoxDriver();
driver.get("http://192.168.2.128:8080/selenium/index.jsp");
List<WebElement> elesByTagName = driver.findElements(By.tagName("input"));
for(WebElement ele : elesByTagName){
System.out.println(ele.getAttribute("type"));
System.out.println(ele.getAttribute("id"));
System.out.println(ele.getAttribute("value"));
System.out.println(ele.getAttribute("title"));
}
}
标签:int password href 多个 nbsp put exce text webdriver
原文地址:http://www.cnblogs.com/liuhaixia/p/7120502.html