Angular JS App将使用Javascript进行测试 [英] Angular JS App to be tested with Javascript

查看:56
本文介绍了Angular JS App将使用Javascript进行测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在尝试使用chromedriver和Javascript的组合来自动化Angular JS App。我们在角度应用程序中识别树视图控件时遇到问题



我们的代码如下所示:

We are trying to automate Angular JS App using a combination of chromedriver and Javascript. we had problems in identifying the tree view controls in the angular app

Our code looks like this:

var webdriver = require('selenium-webdriver');
var driver = new webdriver.Builder().withCapabilities(webdriver.Capabilities.chrome()).build();
driver.get('URL');



我尝试过使用CSS和Xpath,但在命令行执行时,它会提示Xpath为Undefined或CSS为undefined。



有人可以在这方面帮助我吗?


I have tried using CSS and Xpath but while executing it in the command line it prompts as Xpath as Undefined or CSS as undefined.

Could someone help me out in this regard?

推荐答案





我在上面的代码中看不到任何访问DOM节点的代码。请分享一下。



另外,快速推荐而不是使用selenium webdriver你可以使用量角器进行E2E测试。



量角器 - AngularJS的端到端测试 [ ^ ]



这是使用硒测试AngularJS应用程序的推荐方法。



如果您对此有任何疑问,请与我们联系。
Hi,

I don't see any code to access the DOM node in the above code. Please share it.

Also, a quick recommendation rather than using selenium webdriver you can look into using protractor for E2E testing.

Protractor - end to end testing for AngularJS[^]

It's the recommended way of testing AngularJS applications using selenium.

Let me know if you've any questions with regards to it.


这篇关于Angular JS App将使用Javascript进行测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆