自动化页面并检查页面是否正确加载的最佳方法 [英] Best way to automate a page and check if it is loaded correctly

查看:200
本文介绍了自动化页面并检查页面是否正确加载的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望验证此页面是否正确加载- http://www2.hm. com/en_ca/women.html

I am looking to verify if this page loads correctly - http://www2.hm.com/en_ca/women.html

这些是我认为最好验证页面是否正确加载的东西,如果我缺少任何内容,请告诉我

These are the things I think it would be best to verify if the page is loaded correctly, please let me know if I am missing anything

1)验证此页面上的所有链接都有效吗?

1) Verify all the links on this page works?

2)验证顶部菜单是否正确装入,我是否需要验证菜单名称?

2) Verify if the menu on the top is loaded correctly, Do I need to verify the menu names?

3)检查类是否正确加载?

3) Check if the classes are loaded properly?

4)获取/发布请求状态200和其他ajax调用?

4) get/post request status 200 and other ajax calls?

推荐答案

根据您的问题,单独测试检查页面是否正确加载将是完整的间接费用 >,因为 Client (即 Web浏览器)在将直到 Execution Control 不会返回到 WebDriver 实例之前,除非"document.readyState"等于完整" .一旦满足此条件,Selenium将执行下一行代码.

As per your question a seperate test to check if the page is loaded correctly will be a complete overhead because the Client (i.e. the Web Browser) will never return the Execution Control back to the WebDriver instance until and unless 'document.readyState' is equal to "complete". Once this condition is fulfilled Selenium performs the next line of code.

您可以在 Selenium IE WebDriver仅在调试时有效

接下来,您要验证此页面上的所有链接是否有效,您可以编写function()并在需要时调用function().

Next as you want to Verify if all the links on this page works or not , you can write a function() and invoke the function() whereever required.

继续下一个问题,因为您无法测试每个的各个方面,所以不必验证顶部菜单是否正确加载 WebPage 上显示的WebElement .最好的方法是仅验证和验证我们需要与之交互的那些元素的属性.

Moving on to next question, there is no necessity to Verify if the menu on the top is loaded correctly or not as you can't test each and every aspect of each and every WebElement present on a WebPage. The best approach would be to verify and validate the attributes of only those elements with whom we need to interact.

再次检查类是否正确加载将是开销,因为 JVM 会以最佳方式对其进行处理.

Again Checking if the classes are loaded properly will be a overhead as JVM takes care of it in the best possible way.

最后,要验证获取/发布请求状态200 ,您必须根据需要编写 Tests .

Finally, to validate get/post request status 200 you have to write Tests as per your requirement.

这篇关于自动化页面并检查页面是否正确加载的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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