After Double click on IE9 webdriver is not working further

43 views
Skip to first unread message

Jitendra Sahoo

unread,
Mar 26, 2015, 10:31:18 AM3/26/15
to seleniu...@googlegroups.com

Hi,

After Double clicking on a textbox in IE9  , i am getting one popup, ihave to work on the popup. but my issue is after double clicking on the textbox ,my code is not working ,even its not throwing the exception also.its getting hanged.

I tried with Action class and JavascriptExecutor also  , In both the process double clicking is happening , But after that nothing is working.

Note: the application will only run on IE.

Thanks,
Jitendra
IssuePage.jpg

Xiang Dong

unread,
Mar 27, 2015, 12:24:18 AM3/27/15
to seleniu...@googlegroups.com
your javascript call showModelDialog method and it block the web driver and hang your whole execution.

I had an answer for same question a couple days before, you can check the forum and find it.

--david


Date: Thu, 26 Mar 2015 07:31:17 -0700
From: jite...@gmail.com
To: seleniu...@googlegroups.com
Subject: [selenium-users] After Double click on IE9 webdriver is not working further
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/ae6440d6-4c8f-451d-8369-638b82bb986c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jitendra Sahoo

unread,
Mar 27, 2015, 12:51:44 AM3/27/15
to seleniu...@googlegroups.com
Hi David,

Thanks for your reply, can you please share the link of your forum. Then i can look in to it.

Thanks,
Jitendra

Xiang Dong

unread,
Mar 27, 2015, 12:56:18 AM3/27/15
to seleniu...@googlegroups.com
way to do it is delegate the click action to javascript timeout method, it means the click action does not invoke showModalDialog immediately, instead of it, it will ask a javascript timeout method to do it. with it, your web driver will no longer be blocked by the modal window. codes are below:

WebElement webElement = //find your element here
String shortName = "click";
String event = "onclick";
String eventScript =  "if(watp_watp_target == null || watp_watp_target == 'undefined'){return;} try{if(document.createEvent){var evObj = document.createEvent('MouseEvents');evObj.initEvent('"+ shortName + "', true, false); watp_watp_target.dispatchEvent(evObj);} 
else if(document.createEventObject) 
{ watp_watp_target.fireEvent('"+ event + "');}}catch(e){}";
String setTimeoutScript = "var watp_watp_target=arguments[0];setTimeout(function(){"+eventScript+"},100)";
WebDriver webDriver = ((WebDriverWrapper) context.getWebDriver()).getWebDriver();
JavascriptExecutor js = (JavascriptExecutor) webDriver;
js.executeScript(setTimeoutScript, webElement);  

Above codes will be executed when you want to click the element by web driver. Then, you can switch to the new opened modal window and continue your test.

Best Regards,
--david


Date: Thu, 26 Mar 2015 21:51:44 -0700
From: jite...@gmail.com
To: seleniu...@googlegroups.com
Subject: Re: [selenium-users] After Double click on IE9 webdriver is not working further

Jitendra Sahoo

unread,
Apr 10, 2015, 7:20:21 AM4/10/15
to seleniu...@googlegroups.com
Hi,

I am unable to understand the code can you please make it more clear
Reply all
Reply to author
Forward
0 new messages