简体   繁体   English

如何处理javascript弹出窗口:似乎像一个警报窗口,重定向到url:具有表单字段

[英]how to handle javascript pop up :seems like an alert window redirecting towards a url :having form fields

Consider the following scenario: I need to click on the link name "testing" (name field) which it opens a window (confusion is what type of window it is, as there are no maximize, minimize options) 考虑以下情形:我需要单击链接名称“测试” (名称字段),它会打开一个窗口(混淆是什么类型的窗口,因为没有最大化,所以最小化了选项)

  1. this new window is not caught by driver.getwindowhandle() . 这个新窗口不会被driver.getwindowhandle()捕获。
  2. tried as an alert box, but still no response 尝试作为警报框,但仍然没有响应

In current scenario of my code: after I click on the "testing" link, the driver gets lost somewhere. 在我的代码的当前情况下:单击“测试”链接后,驱动程序会迷失在某个地方。 Output of system.out.println(driver); 输出system.out.println(driver); does not get printed until I close the window. 关闭窗口后,才能打印。

I applied thread.sleep(timeseconds) , but again, no response. 我应用thread.sleep(timeseconds) ,但同样,没有响应。

What is the type of this window: containing text fields? 此窗口的类型是什么:包含文本字段? How to get into it? 如何进入呢?

Step 1: Main Page 步骤1:首页

在此处输入图片说明

Step 2: (click on "testing" link => Loading... ) 步骤2 :(点击“测试”链接=> 正在加载...

在此处输入图片说明

Step 3: (once loaded, new window appears) 步骤3 :(一旦加载,就会出现新窗口)

在此处输入图片说明

Step 4: Here is the code: it returns no response after clicking on the link. 步骤4:这是代码:单击链接后,它不返回任何响应。 It does not catch the window using handle. 它不使用手柄抓住窗口。 New window page load takes hardly 4 seconds. 新窗口页面加载几乎不需要4秒。

在此处输入图片说明

Step 4: source code of pop up window -- seems like a frame 步骤4:弹出窗口的源代码-看起来像一个框架 在此处输入图片说明

这不是一个窗口,而是一个框架,您必须使用其ID或名称切换到框架,然后进入其中并执行操作,然后切换到DefaultContent()以从框架切换回

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM