Is WebDriver supports Angular JS 2 for Automation

已查看 111 次
跳至第一个未读帖子

Subbarayulu Neela

未读,
2016年1月7日 01:29:012016/1/7
收件人 seleniu...@googlegroups.com、webd...@googlegroups.com
Hi,

Is WebDriver supports for UI Automation which are developed by Angular JS2?

Could any one help me in this and share any examples and etc.

--
     Your's
N.subbarayulu

darrell

未读,
2016年1月7日 12:39:282016/1/7
收件人 webdriver、seleniu...@googlegroups.com
WebDriver will allow you to automate Angular JS applications. The biggest issue with libraries like Angular JS is that they use AJAX in order to update things on the web page. I can write an application with Angular JS which never finishes loading. when I enter a URL in the address bar, without Angular JS, there is a concept of the page finishing to load. If there is no AJAX or Javascript on the page then once I get the onload signal, I know everything I am looking for is on the page.

With anything AJAX and a lot of Javascript web pages, after onload the Javascript can load additional items. For example, I can use javascript to determine which country you are in. If you are in say USA, I can then use AJAX to query a server, get a list of states and update the "State" web element with a list of valid states. When the page first loads, the "State" SELECT might have no OPTION elements. A few milliseconds later it will get updated with all the OPTION values for your country. If you are testing the site manually, the "State" SELECT gets populated faster than you can open it. Or as a manual tester, if you open it and it is empty, you'll close it and try again. Usually on the second attempt it will be fully populated.

With WebDriver, it is MUCH faster than a manual tester. So you must ask it to wait. There is a feature in WebDriver called WebDriverWait. You can read more about it at http://darrellgrainger.blogspot.ca/2013/10/webdriverwait.html.

Serguei Kouzmine

未读,
2016年1月21日 11:43:122016/1/21
收件人 Selenium Users、webd...@googlegroups.com
Hello, Subbarayulu

Check my recent post
http://www.codeproject.com/Articles/1066968/Developing-Protractor-tests-in-Csharp-or-Java
and github projects
https://github.com/caarlos0/jProtractor
https://github.com/sergueik/powershell_selenium/tree/master/csharp/protractor-net
 - one can access all Protractor API from java or c#
Let me know if you need help and escalate if you encounter any issues

Thanks

Serguei Kouzmine

Robert

未读,
2016年1月21日 16:10:192016/1/21
收件人 webdriver、seleniu...@googlegroups.com
Serguei,

I'm looking over protractor-jvm ... a really clean interface !!! :-).  We are looking for something to wrap up our calls against angular applications, and this looks like it will work for us.

I do have some additional questions for you:
  • Is the project supported on Maven central?
  • Are there any licensing restrictions for using protractor-jvm?
  • Are there any wait* style methods implemented in protractor-jvm ... is this something that is required?

Manoj K

未读,
2016年1月27日 05:52:222016/1/27
收件人 webdriver、seleniu...@googlegroups.com

Mark Collin

未读,
2016年1月27日 10:01:202016/1/27
收件人 Selenium Users、webd...@googlegroups.com
Yes, you'll probably need to add an explicit wait that will tell you when angular has finished processing, apart from that it's rendered as normal HTML.

Mark Collin

未读,
2016年1月27日 10:05:082016/1/27
收件人 webdriver、seleniu...@googlegroups.com
Yes, it does.

Serguei Kouzmine

未读,
2016年2月3日 00:35:272016/2/3
收件人 webdriver、seleniu...@googlegroups.com
Hello

Every interaction with a NgWebElement or NgWebDriver


invokes a `waitForAngular` e.g.
```
@Override
public NgWebElement findElement(final By by) {
this.waitForAngular();
return new NgWebElement(this, this.webDriver.findElement(by));
}
```
```
@Override
public void click() {
this.driver.waitForAngular();
this.element.click();
}
```
 you can calll ``waitForAngular` explicitly or through `assertTrue(element.isDisplayed());`
For practical examples and for combining Protracror with core Selenium, see my article [
Developing-Protractor-tests-in-Csharp-or-Java](http://www.codeproject.com/Articles/1066968/Developing-Protractor-tests-in-Csharp-or-Java)


The code is on github, just like the genuine Protractor, licensing matters should be addressed in the same  fashion

Thanks, let me know if you need anything else
Serguei Kouzmine



回复全部
回复作者
转发
0 个新帖子