量角器可以测试一个没有角度的登录吗?

时间:2021-11-01 04:51:34

I am testing an application written predominantly in angularjs however some elements of the application are written in .NET C#, such as the login form.

我正在测试一个主要在angularjs中编写的应用程序,但是应用程序的某些元素是在. net c#中编写的,比如登录表单。

My question is this.

我的问题是这样的。

Can I leverage Protractor and test my application fully with e2e testing.

我可以使用量角器来充分测试我的应用程序吗?

I have tried using protractor and I am happy with it thus far. However I do not seem to be able to test a page that written in .NET. I am not sure if this is because protractor only tests the elements of an angular application or if it is the way I have written my tests.

我试过使用量角器,到目前为止我对它很满意。但是,我似乎不能测试用。net编写的页面。我不确定这是不是因为量角器只测试角应用的元素或者是我写测试的方式。

I have tried searching for the elements in the page like the example below.

我尝试搜索页面中的元素,如下面的示例所示。

ptor.findElement(protractor.By.xpath('/html/body/div/div[1]/section/input')).sendKeys('xxx');

But this only returns an UnknownError: javascript error: cannot call method 'get' of undefined.

但这只返回一个UnknownError: javascript错误:无法调用未定义的方法“get”。

I know that this error means the elements are not visible on the page however I have placed a timeout in my test shown below

我知道这个错误意味着在页面上不可见元素,但是我在下面显示的测试中放置了一个超时

it('this is a test', function() {}, 10000);

它('this is a test', function() {}, 10000);

all I reuire is to be able to add text to a dynamically created input box, created by Html.TextBoxFor()

我所要做的就是将文本添加到由Html.TextBoxFor()创建的动态创建的输入框中

1 个解决方案

#1


15  

After placing the issue on github I received the answer I was looking for. This can be found HERE!

在github上发布了这个问题之后,我得到了我正在寻找的答案。这个可以在这里找到!

Protractor requires that Angular be present on the page and the way around this is to use the driver directly. Following the link above should stear anyone stuck on the same issue in the right direction.

量角器要求在页面上呈现出角度,围绕这个的方法是直接使用驱动程序。按照上面的链接,任何人在同一问题上坚持正确的方向。

Kudos to JulieMR and the others who helped out with this issue.

感谢JulieMR和其他帮助解决这个问题的人。

#1


15  

After placing the issue on github I received the answer I was looking for. This can be found HERE!

在github上发布了这个问题之后,我得到了我正在寻找的答案。这个可以在这里找到!

Protractor requires that Angular be present on the page and the way around this is to use the driver directly. Following the link above should stear anyone stuck on the same issue in the right direction.

量角器要求在页面上呈现出角度,围绕这个的方法是直接使用驱动程序。按照上面的链接,任何人在同一问题上坚持正确的方向。

Kudos to JulieMR and the others who helped out with this issue.

感谢JulieMR和其他帮助解决这个问题的人。