I am testing angular js application
Angular js App Link
when I click on the UI Kit link in a web application, I get the following error:
on demoaj.Ajapp.main (Ajapp.java:16) Called: org.openqa.selenium.NoSuchElementException: Could not find element: {"method": "xpath", "selector": "html / body / div 1 / div 1 / aside / div / div / μl / Li [2] / a "} Duration or timeout of the command: 51 milliseconds. For documentation on this bug, please visit: http://seleniumhq.org/exceptions/no_such_element.html
I'm new to this, I did some research on this AngularJS
Java code
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();
I think he cannot find the element, because in angularjs dom is not a rendering. when I check the source of the page, it does not display anything that hides all things after doing some research on testing angularjs. I have few questions, please help,
for angular application testing.
- Think I need to use a protractor? I think
- If I use protractor, do I need to write code in javascript or jquery?
- If I use protractor, can I write my code in java using eclipse ide or intellij?
Please, help,
Thanks in advance.
source share