How to handle a new window

21 views
Skip to first unread message

johnNewbie

unread,
Mar 22, 2010, 12:59:26 PM3/22/10
to Selenium Users
Hello,

I am new to selenium so this is probably easy to do. Is there a way to
use a regexp on a selectWindow name?

I am trying to run a report and verify the text on the report.

selenium.click("//input[@value='Run Report']"); // opens a new window
with the report info. The window name is dynamically generated and
the title of the original window and report window have the same
title.

selenium.selectWindow("name=reportPage7949362521241992");

is there a way to do something such as
selenium.selectWindow("name=reportPage*")?

I have tried using
stringArray = selenium.getAllWindowNames();; // it returns only the
first window name and not the report window

Any help would be greatly appreciated.

Thanks,
John

sasidhar karri

unread,
Mar 23, 2010, 12:42:43 AM3/23/10
to seleniu...@googlegroups.com
Hi John,

try with the below command.

selenium.selectWindow(selenium.getAllWindowNames()[1]);

But are you sure, it's a new window? if it's popup window the above command will not work.


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.




--
Regards,
Sasi

Piyush

unread,
Mar 23, 2010, 7:59:52 AM3/23/10
to Selenium Users
HI,

I am trying to automate a functionality where we have to select a
person.we need to search the person is a pop up and then add.THe pop
up opens after the clicking on "add" link.
The proble is that Selenium opens, puts the desired test for
searching, but fails when the operation requires it to click "search"
button.

What could be the reason?

On Mar 23, 9:42 am, sasidhar karri <sasi.ka...@gmail.com> wrote:
> Hi John,
>
> try with the below command.
>
> selenium.selectWindow(selenium.getAllWindowNames()[1]);
>
> But are you sure, it's a new window? if it's popup window the above command
> will not work.
>

> On Mon, Mar 22, 2010 at 10:29 PM, johnNewbie <jlawh...@secureworks.com>wrote:
>
>
>
> > Hello,
>
> > I am new to selenium so this is probably easy to do. Is there a way to
> > use a regexp on a selectWindow name?
>
> > I am trying to run a report and verify the text on the report.
>
> > selenium.click("//input[@value='Run Report']");  // opens a new window
> > with the report info.   The window name is dynamically generated and
> > the title of the original window and report window have the same
> > title.
>
> > selenium.selectWindow("name=reportPage7949362521241992");
>
> > is there a way to do something such as
> > selenium.selectWindow("name=reportPage*")?
>
> > I have tried using
> >  stringArray = selenium.getAllWindowNames();; // it returns only the
> > first window name and not the report window
>
> > Any help would be greatly appreciated.
>
> > Thanks,
> > John
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Selenium Users" group.
> > To post to this group, send email to seleniu...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > selenium-user...@googlegroups.com<selenium-users%2Bunsubscribe@go oglegroups.com>

johnNewbie

unread,
Mar 24, 2010, 1:49:08 PM3/24/10
to Selenium Users
Hi Sasi,

Thank you for the reply.

I am sorry I thought it was a new window but it is a popup.

John


On Mar 23, 12:42 am, sasidhar karri <sasi.ka...@gmail.com> wrote:
> Hi John,
>
> try with the below command.
>
> selenium.selectWindow(selenium.getAllWindowNames()[1]);
>
> But are you sure, it's a new window? if it's popup window the above command
> will not work.
>

> On Mon, Mar 22, 2010 at 10:29 PM, johnNewbie <jlawh...@secureworks.com>wrote:
>
>
>
>
>
> > Hello,
>
> > I am new to selenium so this is probably easy to do. Is there a way to
> > use a regexp on a selectWindow name?
>
> > I am trying to run a report and verify the text on the report.
>
> > selenium.click("//input[@value='Run Report']");  // opens a new window
> > with the report info.   The window name is dynamically generated and
> > the title of the original window and report window have the same
> > title.
>
> > selenium.selectWindow("name=reportPage7949362521241992");
>
> > is there a way to do something such as
> > selenium.selectWindow("name=reportPage*")?
>
> > I have tried using
> >  stringArray = selenium.getAllWindowNames();; // it returns only the
> > first window name and not the report window
>
> > Any help would be greatly appreciated.
>
> > Thanks,
> > John
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Selenium Users" group.
> > To post to this group, send email to seleniu...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > selenium-user...@googlegroups.com<selenium-users%2Bunsubscribe@go­oglegroups.com>


> > .
> > For more options, visit this group at
> >http://groups.google.com/group/selenium-users?hl=en.
>
> --
> Regards,

> Sasi- Hide quoted text -
>
> - Show quoted text -

Reply all
Reply to author
Forward
0 new messages