51Testing软件测试论坛
标题:
testng中怎么取不到属性值。。。
[打印本页]
作者:
dian106106
时间:
2012-4-27 15:54
标题:
testng中怎么取不到属性值。。。
package ENSG;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.*;
import static org.testng.Assert.*;
import com.thoughtworks.selenium.*;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
@Test
public class headerBar {
public void msnlogo() {
WebDriver driver = new FirefoxDriver();
driver.get("http://xin.msn.com/default.aspx");
WebElement headlogo=driver.findElement(By.id("headlogo"));
String width = headlogo.getAttribute("src");
System.out.println(width);
}
}
作者:
Alawn
时间:
2017-12-27 21:41
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2