使用Selenium的弹出式Windows的问题 [英] Problem with Pop-up Windows using Selenium

查看:94
本文介绍了使用Selenium的弹出式Windows的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是测试领域的新手,所以我的问题似乎有点天真和愚蠢.冒着看起来/听起来很愚蠢的风险,我的问题是这样的:

I'm new to the testing world, so my question might seem a lil' bit too naive and stupid. At risk of looking/sounding stupid, my question is this:

我一直在尝试在公司网络应用程序的弹出窗口中测试内容.我现在已经知道了如何检测弹出窗口,但是我无法让硒点击"该弹出窗口内的链接.此Web应用程序中有多个弹出窗口,因此对于新手来说,要创建测试用例真的很困难.

I've been trying to test the contents in a pop-up window on my company's web app. I've figured out how to detect the pop-up window for now, but i can't get selenium to 'click' on the link inside of that pop-up window. there are multiple pop-ups in this web app so it's really difficult for a newbie like to create a test case.

我尝试了click,clickAndWait,mouseDown和mouseKey作为选项,但仍然无法使用.有人可以引导我做这个吗?

I tried the click, clickAndWait, mouseDown and mouseKey as an option but it is still not working. can somebody guide me through this?

TIA, 安吉拉(Angela)

TIA, Angela

推荐答案

出现弹出窗口时,您需要将脚本的上下文移至窗口.

When the popup appears you will need to move the context of the script over to the window.

您可以使用selectWindow | window_ID_from_the_link进行此操作,然后单击.

You can do this by using the selectWindow | window_ID_from_the_link and then do the clicking.

如果这不起作用,则可能需要使用openWindow命令创建弹出窗口,然后针对该弹出窗口进行测试.

If that doesn't work you may need to use the openWindow command to create the popup and then start testing against that.

这篇关于使用Selenium的弹出式Windows的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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