如何在非angularjs网站上使用量角器? [英] how to use Protractor on non angularjs website?
问题描述
我已经找到量角器框架,这是AngularJS web应用开发的。
I have found Protractor framework which is made for AngularJS web applications.
我怎么可以用量角器未使用AngularJS在网站上?
how can I use Protractor on a website which is not using AngularJS?
我写我的第一个测试和量角器触发此消息:错误:角不能在页面https://www.stratexapp.com/找到:重找角度超过
I wrote my first test and Protractor triggers this message : Error: Angular could not be found on the page https://www.stratexapp.com/ : retries looking for angular exceeded
推荐答案
如果您的测试需要用无棱角页面交互,直接与 browser.driver $ C $访问实例的webdriver C>。
If your test needs to interact with a non-angular page, access the webdriver instance directly with browser.driver
.
从<一个实例href=\"https://github.com/angular/protractor/blob/f52438549f7d920da1600199feaf58059d6fd692/spec/withLoginConf.js\">Protractor文档
browser.driver.get('http://localhost:8000/login.html');
browser.driver.findElement(by.id('username')).sendKeys('Jane');
browser.driver.findElement(by.id('password')).sendKeys('1234');
browser.driver.findElement(by.id('clickme')).click();
这篇关于如何在非angularjs网站上使用量角器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!