Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

selenium is hanging when doing "click" in one window, which will trigger alert in another window #2274

Open
lukeis opened this issue Mar 3, 2016 · 13 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 3, 2016

Originally reported on Google Code with ID 2274

What steps will reproduce the problem?
1. See attached 2 html files and copy them into web server.
2. Use selenium2.2 webdriver to drive the following steps.
3. Open a.html(window1), click the link which will open popup window2.
4. Click button in the popup window.
5. Selenium is hanging here and cannot go to get the alert shows up in the window1

What is the expected output? What do you see instead?
Expected: Selenium can go ahead to handle the following alert.
Actual: Selenium is hanging when clicking the button in the popup window. 

Selenium version: selenium2.2
OS: window7
Browser: Firefox
Brower version: 3.6.18

Reported by chenxu1985 on 2011-08-16 10:31:33


- _Attachment: [a.html](https://storage.googleapis.com/google-code-attachments/selenium/issue-2274/comment-0/a.html)_ - _Attachment: [b.html](https://storage.googleapis.com/google-code-attachments/selenium/issue-2274/comment-0/b.html)_
@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Is there anyone to take a look at this issue?
It's better to show workaround first.

Reported by chenxu1985 on 2011-08-17 02:31:33

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

I just tried this on FF 3.6 on mac with Se 2.3 (i think) and didn't run into the issue.
Using python bindings. I will attempt again tomorrow on windows. Which language bindings
are you using? (Shouldn't matter much for this bug, but I'd like to see if i can reproduce
it).

Reported by luke.semerau on 2011-08-19 05:20:16

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Now I updated to Selenium2.4, but still blocked here. BTW, I am using Java.

Reported by chenxu1985 on 2011-08-19 07:22:27

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

I can confirm, Win7 x64 + FF6.0.2, selenium 2.7

    public void test() throws Exception {
       WebDriver driver = new FirefoxDriver();
       driver.get("http://localhost/a.html");
       driver.findElement(By.id("openPopUp")).click();
       driver.switchTo().window("popupwindow");
       driver.findElement(By.id("backBtn")).click();
       driver.switchTo().defaultContent();
       driver.switchTo().alert().accept();
    }

Firefox driver blocks in click to "backBtn" when alert appears. If one close alert
manually, driver runs ahead, FF console shows the following error message:

Error: [Exception... "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED)
[nsIDOMJSWindow.setTimeout]"  nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)"  location:
"JS frame :: file:///C:/Users/alexei/AppData/Local/Temp/anonymous8220979579020877102webdriver-profile/extensions/fxdriver@googlecode.com/components/nsCommandProcessor.js
:: <TOP_LEVEL> :: line 198"  data: no]
Source: file:///C:/Users/alexei/AppData/Local/Temp/anonymous8220979579020877102webdriver-profile/extensions/fxdriver@googlecode.com/components/nsCommandProcessor.js
Line: 198

[WARNING] dispatcher.js:344 =============
Supported interfaces: nsIException, nsIXPCException, nsIClassInfo, nsISupports, 
------------
    QueryInterface:  function()
    columnNumber: 0
    data: null
    filename: file:///C:/Users/alexei/AppData/Local/Temp/anonymous8220979579020877102webdriver-profile/extensions/fxdriver@googlecode.com/components/nsCommandProcessor.js
    initialize:  function()
    inner: null
    lineNumber: 198
    location: JS frame :: file:///C:/Users/alexei/AppData/Local/Temp/anonymous8220979579020877102webdriver-profile/extensions/fxdriver@googlecode.com/components/nsCommandProcessor.js
:: <TOP_LEVEL> :: line 198
    message: Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIDOMJSWindow.setTimeout]
    name: NS_ERROR_NOT_INITIALIZED
    result: 3253927937
=============

Two messages, to be precise, both are the same.

Driver dies with

java.lang.ClassCastException: com.google.common.collect.Maps$TransformedEntriesMap
cannot be cast to java.lang.String
    at org.openqa.selenium.remote.RemoteWebDriver$RemoteTargetLocator.alert(RemoteWebDriver.java:598)

as the error code in unknown.

Reported by barancev on 2011-09-23 22:15:35

  • Labels added: Browser-Firefox

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Thanks for barancev's information.
Is there anyone to work on this issue?

Reported by chenxu1985 on 2011-09-28 08:10:15

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Reported by barancev on 2011-10-13 07:56:06

  • Labels added: Component-WebDriver

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

I tried on the latest selenium2.21, this issue still blocks script. Does anyone know
any workaround?

Reported by chenxu1985 on 2012-05-28 05:25:02

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Just update: When I disabled native event, the click thread can go ahead and alert can
be accepted.
But for this workaround, can anyone explain more about native event? Since I am not
sure whether the change would impact more situations.

Reported by chenxu1985 on 2012-05-31 10:31:59

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Is there anyone to work on this issue?
Although there is workaround, but my script is blocked by this issue when tests need
native event to support action such as mouse over.

Reported by chenxu1985 on 2012-07-03 07:17:44

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Stil actual.

I's reproduced by data from #c0 and #c4 with native events at Win7, FF23, Selenium
2.35
and is not with synthethic events.

Reported by a.u.savchuk on 2013-09-20 10:54:16

  • Status changed: Accepted

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

I tried with 
Windows XP, FF19, Selenium 2.35. 
Windows XP, FF11, Selenium 2.21

1. Open a link
2. Fill a form
3. Click on Submit button 
4. Confirmation Pop up for Submit appears. (Not able to get control on the Pop up)

I am not able to have any control on the confirmation Pop-up.
I tried implicit wait, Thread.sleep. Still not working. Pls help

Reported by dataminer56 on 2013-09-27 12:40:37

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

i am facing the exact same issue on Internet explorer.

I tried with windows 8, selenium 2.45 with  C#


Please Update me about its fix

Reported by syed.ali.mesam on 2015-06-11 06:59:53

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Reported by luke.semerau on 2015-09-17 17:44:25

  • Labels added: Restrict-AddIssueComment-Commit

@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant