Re: Using Selenium IDE to handle modals

1,046 views
Skip to first unread message

James Johnson

unread,
Aug 15, 2012, 1:53:53 PM8/15/12
to seleniu...@googlegroups.com
Greetings,

I would highly suggest having a step to WaitforElementPresent or WaitForVisible prior to the object in step 4. 
I think what is happening is the test clicks on the object (something matching the xpath) but the object you wanted really isn't in focus yet.
Therefore the test is sitting there waiting for the standard timeout to eventually say it cannot locate the object.

You can speed up the debugging process by using setTimeout and use 500 milliseconds.  its likely your timeout is set to 1 minute or more.

In cases like this If you are using IDE, try using the "Highlight Elements (Selenium IDE)" add-on which is really helpful to highlight each object as the test runs.

James


On Tuesday, August 14, 2012 11:38:57 AM UTC-4, ALISTER ERNEST wrote:
I need help solving this issue for the IDE only.

Selenium IDE - v1.9.0
Firefox - v14.0.1

I am working on getting some high level recorded/playback tests for my organization when I stumbled upon something that I had never seen the IDE do so far.

Our WebApp is designed to have a portal that has options. 
Clicking on one of the option launches another window which holds all functionalities for that option.
One of the links in the newly launched window, when clicked, opens a modal.

My TEST -
Step 1 - Logs in to ParentWindow (Portal)
Step 2 - Clicks on OptionA in portal to open NewWindowA
Step 3 - Then selects the NewWindowA
Step 4 - Clicks on LinkA in NewWindowA to open ModalA
Step 5 - Clicks button "OK" in ModalA to close ModalA
Step 6 - Selects NewWindowA again
Step 7 - Closes NewWindowA
Step 8 - Selects ParentWindow (Portal)
Step 9 - Finally Logs out of ParentWindow (Portal)


The ISSUE I am seeing is that -  
Playback stops (like in a loop - test does not pause or stop executing) at "Step 4" though the ModalA is successfully opened, and the test does not proceed to the next step.
I see the IDE log saying "[info] Executing: |click | link=openModalA | |"
It seems like it running this command in a loop waiting for something, but I do not have any wait declared in the IDE for this step.
Also, I saw that if I manually closed the "ModalA"  the test continues, as though it just broke/escaped from a loop.

Not sure why this is so, or what I can do to solve this.
But I want to solve this for the Selenium IDE first.
I know there are way to do the same using SeleniumRC or WebDriver, but for now any help regarding the solution using the IDE will be greatly appreciated.

ALISTER ERNEST

unread,
Aug 28, 2012, 2:59:36 PM8/28/12
to seleniu...@googlegroups.com
Hi Kathy,

Sometimes the modals are also defined as Frames.
You can try using the "selectFrame" command, and to supply the frame name you might have to look at some of the HTML using either "Inspect Element" option or just plain FireBug in Firefox.

If this fails, the only other thing I can think of is that, the modal is defined as a window but there was a Frame defined in it. If this is the case you would have to use these 2 commands:
1. select Window "WindowName"
2. select Frame "FrameName"

Hope this helps.

Thanks,
Alister

On Tuesday, August 28, 2012 11:21:24 AM UTC-6, Kathy Phan wrote:
HI Alister,
 
I'm facing the same issue that you were having.   I'm stuck at the same point as your step 5.  I was using the command SelectWindow and provided the actual Modal window name, but the script does not proceed.  Can you please let me know what commands did you use to open the Modal Window? 
 
Thanks a lot for your help.
 
-Kathy
 
 

On Monday, August 27, 2012 10:54:14 AM UTC-7, ALISTER ERNEST wrote:
Hi James, 

Thank you for the reply.
I kinda figured out the issue. Selenium IDE was not recording the actual Modal Name, instead it was just using the window title as its Modal Name.
When I modified the Modal Name to the actual, by digging into the HTML behind the modal, the test just ran fine.

Thanks,
Alister Ernest
Reply all
Reply to author
Forward
0 new messages