Cha*_*ari 6 java selenium angularjs protractor webdriverjs
我正在测试角度js应用程序
当我点击Web应用程序上的UI Kit链接时,我收到以下错误 -
at demoaj.Ajapp.main(Ajapp.java:16)引起:org.openqa.selenium.NoSuchElementException:无法找到元素:{"method":"xpath","selector":"html/body/div 1/div 1/aside/div/div/ul/li [2]/a"}命令持续时间或超时:51毫秒有关此错误的文档,请访问:http: //seleniumhq.org/exceptions/no_such_element.html
我是新手,我对这个AngularJS进行了一些研究
java代码
package demoaj;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
public class Ajapp {
public static void main(String[] args) throws InterruptedException {
WebDriver d=new FirefoxDriver();
d.manage().window().maximize();
d.get("http://iarouse.com/demo/index.html?product=square");
WebDriverWait wait = new WebDriverWait(d, 20);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("html/body/div[1]/div[1]/aside/div/div/ul/li[2]/a"))).click();
//d.findElement(By.xpath("html/body/div[1]/div[1]/aside/div/div/ul/li[2]/a")).click();
}
}
Run Code Online (Sandbox Code Playgroud)
我认为它无法找到该元素,因为在angularjs中dom不会渲染.当我检查页面源它没有显示任何东西被隐藏后对angularjs测试做一些研究我有几个问题请帮助,
用于Angular App测试.
请帮忙,
提前致谢.
以下是我用来测试 AngularJS 应用程序的一些技术:
| 归档时间: |
|
| 查看次数: |
6220 次 |
| 最近记录: |