How to handle Modal pop-up's or alerts

144 views
Skip to first unread message

Dinesh Kumar R-"The Developer in Test"

unread,
Nov 25, 2015, 12:31:54 AM11/25/15
to Selenium Users
Hi folks,

Since, modal pop-up's are very common now-a-day's, What are the different ways to handle it using web driver.

SantoshSarma

unread,
Nov 25, 2015, 1:07:36 AM11/25/15
to Selenium Users

Refer below post

Krishnan Mahadevan

unread,
Nov 25, 2015, 1:15:43 AM11/25/15
to Selenium Users
How does that post talk about handling modal pop-up ?? which if I understand correctly is basically a popup which would need to be processed before moving further. I was under the impression that Selenium/WebDriver doesnt work very well with modal dialog boxes no ?

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
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/1e864ab5-c55b-407a-84ac-67edac0a0b78%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dinesh Kumar R-"The Developer in Test"

unread,
Nov 25, 2015, 11:50:39 PM11/25/15
to Selenium Users
Hi Krishnan Mahadevan,

Your are right. Till now i couldn't find the easy way to handle modal's like it is for normal alert's. Currently i am handling it by taking element locators of "OK" or "Cancel" buttons in modal and performing click operations.

Dinesh Kumar R-"The Developer in Test"

unread,
Nov 25, 2015, 11:54:36 PM11/25/15
to Selenium Users
Hi Santosh Sarma,

Thanks for the reply. the solution present in the post was not my context actually. I'll provide you details of exact problem very soon.

Louise

unread,
Dec 1, 2015, 10:29:21 AM12/1/15
to Selenium Users
I've found 2 ways (no perfect solution):

* Robot class to just press Enter key

Veera K

unread,
Dec 2, 2015, 8:50:03 AM12/2/15
to Selenium Users
//switch to the alert or modal popup
Alert alert = driver.switchTo().alert();
//accept the alert
alert.accept();

On Wednesday, November 25, 2015 at 11:01:54 AM UTC+5:30, Dinesh Kumar R-"The Developer in Test" wrote:

Manoj Selenium

unread,
Dec 3, 2015, 6:16:16 AM12/3/15
to seleniu...@googlegroups.com
Dinesh,

For handling model popups/windows  in selenium you need to take three command help 

driver.getWindowHandel() ; This is return patent window property
driver.getwindowHandels(); this will return overall open window properties. Save all the properties then use the below command

driver.switchto.window(supply window property).

Robot class for handle window based controls on the web app

Thanks.



--
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.

For more options, visit https://groups.google.com/d/optout.



--


Thanks,
Manoj.

Srinivas Vedula

unread,
Dec 8, 2015, 12:27:23 PM12/8/15
to Selenium Users


On Wednesday, November 25, 2015 at 11:01:54 AM UTC+5:30, Dinesh Kumar R-"The Developer in Test" wrote:
Reply all
Reply to author
Forward
0 new messages