0

I don't know if it's a"normal" behaviour but I didn't see anything explaining it so far. I am testing a javascript popup that doesn't have a name, to be able to test elements on that popup, I have to wait until popup is fully loaded. I did not use to check if div element is present as it is here but tried something else.

This is what I tried and the strangest thing about is that it works.

  browser.waitForPopUp("window", "3000");

It works in all my popups (none of them has a name). I tried other String such as "default", "null" and even a null String but none of them works (I read somewhere, I forgot where, I will update if I found the link, so I read that if I set the first parameter to "null", then it will make test wait until a popup is loaded, nut when I tried, I only encounter time out issue).

Anybody has a clue about what's happening and why does it work?

Thanks!

1 Answer 1

1

The documentation for the waitForPopUp method can be seen here - http://selenium.googlecode.com/svn/trunk/docs/api/java/com/thoughtworks/selenium/Selenium.html#waitForPopUp%28java.lang.String,%20java.lang.String%29

Regarding the first parameter, it says "windowID - the JavaScript window "name" of the window that will appear (not the text of the title bar) If unspecified, or specified as "null", this command will wait for the first non-top window to appear (don't rely on this if you are working with multiple popups simultaneously)."

I would guess that when you said that your popup does not have a name, you were actually referring to the title. The actual name of your popups is probably actually "window".

On the w3schools example, http://www.w3schools.com/jsref/prop_win_name.asp, you can see the popup's name is not the same as that in the title bar. In fact the name does not appear anywhere.

1
  • You must be right when you say that my popup name is "window" for a reason I don't know yet, I'll try to figure out why. But still, there is something I don't understand, why does it fail when I use null or "null" for first parameter (it is not possible not to specify parameter windowId as far as I know so I only try to set it to null). Do you have any idea? Thanks
    – aslan
    Jul 25, 2012 at 6:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.