Svetlana Kostenko
Svetlana Kostenko

Reputation: 11

Selenium IDE selects wrong window

I have trouble with closing windows in Selenium IDE. It seams Selenium doesn't select window "win2"and continues working with win1. But verifyTextPresent works on win2.

The same thing when I try to close win2. It closes win1 even if I selected win2 previously! Moreover, when I choose actions one by one everything works as I wanted.

open                    https://ru.wikipedia.org/wiki/XPath
storeAllWindowNames     .*Xpath.*                                        win1
openWindow              http://selenium2.ru/docs/selenium-ide.html
storeAllWindowNames  .*selenium.*  win2
selectWindow title=Xpath  — Википедия
clickAndWait link=XML
selectWindow win2
verifyTextPresent Selenium IDE
open anotherlink
close win2

Upvotes: 1

Views: 242

Answers (1)

Jsmith2800
Jsmith2800

Reputation: 1113

The main reason I can see for this is that the close command doesn't use a locator to decide what to close, it will just close the currently selected window, and your 'open' command before your close, will open a new window.

I'd say either change the order, or if you need it that way for some reason you'd need to add in to select the window you want to close, after the open and before the close.

I'm not really familiar with how the 'storeall' functions work, as I've never used them myself, but I know that the selectwindow function works by looking for the window title, so possibly try switching 'Storeallwindownames' for the 'Storeallwindowtitles' function as well

Upvotes: 0

Related Questions