Wednesday, June 16, 2010

To download modified copy of Selenium RC Server (To handle modal window) click here selenium-server.jar

Tag this link to see more updates on Selenium server.


  1. This server jar file does not solve the modal dialog issue.

  2. Is there any other changes that need applying for this new function to work correctly, I've been over and over your previous posts and configured as stated in posts, but cannot get the Return Value to work... please review my post and reply, I'm going insane here trying to figure this hic-cup out! Thanks for all your hard work Amit!

  3. Hi!
    The modified Selenium server handles the return value. This has been tested across various modal dialogs. It would be good if you can share the scenario where this is failing. Is your application on net?

  4. Swift Reply, Thanks!

    I'll post in two parts as to big for one post.

    No sorry App not on the net, my scenario is like so;

    I run though basics entering details to my App, then comes a section where I need to enter details into a Modal (iframe) dialog popup, then click on a submit button to return the values, but this is where Selenium falls over.. It does seem to close the Modal screen but the outer Frame holding the javascript is still visible and will not close even with the /null/ option.

    Snippet of code used:"//div[@class='searchbuttons']/a/span"); //opens Modal popup


    selenium.selectWindow("title=Search Results");"id=_controlwizardNavControl1");
    // clicks Next button in Modal


    selenium.selectWindow("title=Search Results");"titleCode", "Text");
    selenium.type("addressLine(HNNO)", "Text");
    selenium.type("addressLine(STRN)", "Text");
    selenium.type("addressLine(TOWN)", "Text");"autosubmit");
    // on submit button is where the issues comes into play...

  5. I can't seem to close the Modal fully and have return values entered back to parent.

    I checked the outher frame to see whats stored there and it mentions the following -

    // Some background on the code below: broadly speaking, where we are relative to other windows
    // when running in proxy injection mode depends on whether we are in a frame set file or not.
    // In regular HTML files, the selenium JavaScript is injected into an iframe called "selenium"
    // in order to reduce its impact on the JavaScript environment (through namespace pollution,
    // etc.). So in regular HTML files, we need to look at the parent of the current window when we want
    // a handle to, e.g., the application window.
    // In frame set files, we can't use an iframe, so we put the JavaScript in the head element and share
    // the window with the frame set. So in this case, we need to look at the current window, not the
    // parent when looking for, e.g., the application window. (TODO: Perhaps I should have just
    // assigned a regular frame for selenium?)

    Other than that I'm not sure if this issue is on my side or something I'm not setting up correctly...

    BTW, I'm using ProxyMode to run my scenarios as I recieve Js errors in IE if I don't.

    If you need more info on this please do let me know, I'm also willing to record my steps and place my video on the interwebs for you to easily view and see whats happening. if that's any use to you?

    basically it seems your code does work fine but is somehow falling over when it come in cantact with a Modal with embedded iframe, but I noticed in your blog thats what this new fix handles.

    Any ideas what is wrong?
    I appreciate you replying and giving this a go, I can use all the help i get at this point.
    Thanks you Amit.

  6. It seems you are missing to click the first button that opened up the modal dialog. To get the modal returned value back on the parent page, we are suppose to click on the same button again which initially has opened the modal window. As this is a workaround we got to go some extra miles to achieve our target. Briefing down:
    Click parent button (say A). Modal Dialog appears.
    Select Modal Dialog.
    Perform Modal operation.
    Click submit to close modal dialog.
    Select parent window.
    (If required move to the same frame where initially we were)
    Click parrent button again. (A)

    Hope this helps you.

  7. Hi Amit,

    I am trying to test a modal dialog using your modified program. I used your workaround(selenium-server.jar) and selenium-java-client-driver.jar(Ver.1.0-beta-1) to test on IE6 and IE7 with the scenario you wrote. The modal dialog can be opened successfully, but it still failed in exchanging values between main window and dialog.

    If it is possible, could you show me a successful sample(including test tools and their version, sample application and test scenario)? So maybe I can know how different with my test environment.

    Thank you in advance,


  8. Hi Amit! I'm the poster from September 21, 2010 8:48 AM post above, I'm just replying to let you know your fix worked! I wasn't focusing on the parent screen before looking to click the same button that triggered the modal popup and I had to use selenium.selectWindow(null); first to find the button, also I was in ProxyInjectionmode which I now turned off and it's all working smoothly as can be... Thank you very much Amit for all your hard work! Appreciate it ; )

  9. This comment has been removed by the author.

  10. Could you give us a complete sample.
    I try this solution for 3 days without success. Always something wrong, like Could not find window with title xxxx
    Thanks in advance

  11. Hi!

    I have an issue in selecting the modelwindow.

    i have"//input[@value='Associate']"); button which will open the model window. After the model window is opened selenium will break down as it is unable to select the window based on its title and pass the further entry in to the window.

    I have tried your modified selenium server.jar. But no luck. Any suggestion would be greatly help ful.

    Thanks in advance

  12. sorry i forgot to mention that i am using firefox browser.

  13. The work around is just for IE browsers.

  14. wonderful issues altogether, you simply won a new reader.

    What might you recommend in regards to your publish that you
    made a few days ago? Any positive?

    Also visit my page ... gas water heaters Fourways

  15. Every weekend i used to visit this web page, as i wish for enjoyment,
    since this this web site conations truly good funny material

    Also visit my website :: corporate gifts South Africa

  16. Excellent post! We will be linking to this great article on our website.
    Keep up the great writing.

    Also visit my site: cms website design Cape Town

  17. Have you ever thought about creating an e-book or guest authoring on other blogs?
    I have a blog based on the same subjects you discuss and would love to have you share some stories/information.
    I know my visitors would appreciate your work. If you are even remotely interested, feel free
    to send me an e mail.

    my weblog :: click url

  18. I'm amazed, I have to admit. Rarely do I encounter a blog that's equally educative and interesting, and
    without a doubt, you've hit the nail on the head. The problem is an issue that too few people are speaking intelligently about. I'm very happy I found this during my search
    for something relating to this.

    my page; Visit website

  19. An intriguing discussion is definitely worth comment.
    There's no doubt that that you ought to publish more about this subject matter, it might not be a taboo subject but usually folks don't talk about such topics.
    To the next! Cheers!!

    Feel free to visit my site; click url

  20. You should take part in a contest for one of the best sites on
    the internet. I'm going to recommend this web site!

    Feel free to surf to my weblog ... website

  21. This design is incredible! You most certainly know how to keep a reader entertained.
    Between your wit and your videos, I was
    almost moved to start my own blog (well, almost...HaHa!
    ) Wonderful job. I really enjoyed what you had to say, and more than that, how you presented it.
    Too cool!

    Also visit my site - More info

  22. I could not resist commenting. Well written!

    my web site: Infromtion site

  23. Excellent web site you have got here.. It's difficult to find excellent writing like yours these days. I honestly appreciate people like you! Take care!!

    my web site; click here

  24. Hey there I am so glad I found your site, I really found you by error, while I was looking on
    Google for something else, Anyways I am here now and would just
    like to say thanks a lot for a incredible post and
    a all round entertaining blog (I also love the theme/design), I don’t have time to go through it all at the
    moment but I have bookmarked it and also added your RSS feeds,
    so when I have time I will be back to read much more, Please do keep up the superb jo.

    Take a look at my webpage; website link

  25. Nice response in return of this question with real arguments and explaining everything concerning that.

    Feel free to visit my blog post ... website link

  26. Howdy! This post couldn't be written any better! Reading through this post reminds me of my old room mate! He always kept chatting about this. I will forward this post to him. Fairly certain he will have a good read. Thanks for sharing!

    Feel free to visit my site ... financial advisory services

  27. Hi there, just wanted to tell you, I liked this article.
    It was funny. Keep on posting!

    Here is my website - web site designer

  28. I am curious to find out what blog system you happen to be using?
    I'm having some minor security problems with my latest website and I'd
    like to find something more secure. Do you have any recommendations?

  29. Right here is the right blog for anybody who hopes to find out about this topic.
    You understand so much its almost hard to argue with you (not that I personally would want to…HaHa).

    You certainly put a fresh spin on a subject which
    has been discussed for many years. Wonderful stuff, just excellent!

    Also visit my web page Visit here

  30. Thanks for sharing this information.It was very nice blog to learn about Selenium