testng中怎么取不到属性值。。。
上一篇 / 下一篇 2012-04-27 15:55:29 / 个人分类:TestNG/Ant/Eclipse/Java
TAG:
- 引用 删除 dian106106 / 2012-04-27 17:58:50
-
driver.findElement(By.xpath("//img[@alt='msn']")).getAttribute("src");
ok了
- 引用 删除 dian106106 / 2012-04-27 15:57:21
-
用selenium1 就是好的。
package ENSG;
import com.thoughtworks.selenium.*;
import java.util.regex.Pattern;
//import static org.junit.Assert.*;
public class lianxi3 extends SeleneseTestCase {
public void setUp() throws Exception {
setUp("http://xin.msn.com/default.aspx", "*chrome");
}
public void testTest123() throws Exception {
selenium.open("/");
String var=selenium.getAttribute("alt=msn@src");
String var1=selenium.getAttribute("alt=msn@width");
System.out.println(var);
System.out.println(var1);
}
}
标题搜索
日历
|
|||||||||
日 | 一 | 二 | 三 | 四 | 五 | 六 | |||
1 | 2 | 3 | 4 | ||||||
5 | 6 | 7 | 8 | 9 | 10 | 11 | |||
12 | 13 | 14 | 15 | 16 | 17 | 18 | |||
19 | 20 | 21 | 22 | 23 | 24 | 25 | |||
26 | 27 | 28 | 29 | 30 | 31 |
我的存档
数据统计
- 访问量: 74550
- 日志数: 80
- 建立时间: 2012-04-12
- 更新时间: 2013-05-21