URL等于预期时出现错误消息

时间:2016-06-01 10:30:21

标签: javascript node.js selenium-webdriver nightwatch.js

我正在运行此测试,当涉及断言URL内容的部分时,我收到此错误消息。是什么导致这个?为什么?提前谢谢。

Running:  Click 
 √ Element <#azercell_language_selector> was visible after 2482 milliseconds.
 √ Element <#azercell_language_selector option:nth-child(2)> was visible after 1
845 milliseconds.
 × Testing if the URL contains "http://oyun.azercell.com/ru?lang=ru".  - expecte
d "http://oyun.azercell.com/ru?lang=ru" but got: http://oyun.azercell.com/?lang=ru

2 个答案:

答案 0 :(得分:0)

在你的测试中你有一个断言,页面网址是

http://oyun.azercell.com/ru?lang=ru

但你有

http://oyun.azercell.com/?lang=ru

所以你的测试失败了。

在你这边两个网址是相同的,你可以在测试代码中删除这个断言。

答案 1 :(得分:0)

据我所知,验证URL的断言失败了。你需要一个网址

http://oyun.azercell.com/ru?lang=ru

但是您收到了以下网址,其中缺少文字&#39; ru &#39;在&#39; .com / &#39;

之后
http://oyun.azercell.com/?lang=ru

你的断言失败导致了这个问题我相信