自动测试网站/页面 [英] automate testing a website/page

查看:94
本文介绍了自动测试网站/页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我正在尝试打开一个网页,说http://gmail.com",输入用户名,密码,点击提交按钮然后加载其他的东西 - 所有通过自动化,在python中编写脚本。


我在cPAMIE尝试了我的手,但面对prbs注册了gui元素的id,即在htm源文件中没有提到特定gui元素的id的地方,我们无法使用cPAMIE方法。


我现在正在win32com.client尝试我的手,但作为一个新手,我无法令人满意地进行。


任何人都可以指导我完成工作的方式,即建议任何其他模块自动化浏览器,或指向我提供一些信息丰富的教程。


之前已经完成此类工作的任何人,可以吗?请帮帮我?


问候,

rdps

hello,

I am trying to open up a webpage, say "http://gmail.com", enter username, passwd, click on submit button and do loads of other things - ALL THROUGH AUTOMATION, writing a script in python.

I tried my hands at cPAMIE but facing prbs regading the ids of the gui elements i.e. the places where id of a particular gui element is not mentioned in the htm source file, we cannot use the cPAMIE methods.

I am trying my hands at win32com.client now, but being a newbie i am not able to proceed satisfactorily.

Could anyone guide me the way to accomplish my job i.e suggesst any other module to automate browser, or point me to some informative tutorials.

ANYONE WHO HAS DONE SUCH STUFF BEFORE, can u help me please?

Regards,
rdps

推荐答案

进一步添加到我的查询中,如何识别网页上没有html文本中提到的任何id的元素?
Adding further to my query, how to identify the elements on the web page which do not have any id mentioned in the html text ?


当你真正知道你的web组件的名称时,这是一个解决问题的方法。注意ie.ReadyState而不是固定睡眠。我将很快回来使用一个使用组件索引的解决方案。如果要对Web解决方案进行自动测试,我强烈建议您推动开发团队在其组件上使用名称或ID。如果使用名称,您可以进行更好的回归测试。组件的顺序可能会改变。名称和ID也可以更改,但它们通常更持久。

Here is a solution for the problem when you actually know the names of your web components. Notice the ie.ReadyState instead of the fixed sleep. I will be back soon with a solution that uses component index instead. If you are to do automatic tests on a web soluition I would strongly recommend that you push the development team to use names or ids on their components. You can do a much better regression test if names are used. The order of the components might change. Names and ids can also change, but they are usually more lasting.

展开 | 选择 | Wrap | 行号


感谢Fredrik!这个论坛的成员从你的帖子中获得了很多知识,我也是。我非常感谢你坚持下去。顺便说一句,你有没有注意到搜索在发布当前帖子时不能很好地工作?再次感谢,

Barton

Thanks Fredrik! Members of this forum are gaining a lot of knowledge from your posts and so am I. I really appreciate the you for sticking around. BTW, have you noticed that searches don''t work very well in bring up current posts? Thanks, again,
Barton


当您真正了解Web组件的名称时,这是一个解决方案。注意ie.ReadyState而不是固定睡眠。我将很快回来使用一个使用组件索引的解决方案。如果要对Web解决方案进行自动测试,我强烈建议您推动开发团队在其组件上使用名称或ID。如果使用名称,您可以进行更好的回归测试。组件的顺序可能会改变。名称和ID也可以更改,但它们通常更持久。

Here is a solution for the problem when you actually know the names of your web components. Notice the ie.ReadyState instead of the fixed sleep. I will be back soon with a solution that uses component index instead. If you are to do automatic tests on a web soluition I would strongly recommend that you push the development team to use names or ids on their components. You can do a much better regression test if names are used. The order of the components might change. Names and ids can also change, but they are usually more lasting.

展开 | 选择 | Wrap | 行号


这篇关于自动测试网站/页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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