Reference to new browser window

109 views
Skip to first unread message

Mike Teye

unread,
Mar 4, 2015, 11:10:00 AM3/4/15
to co...@googlegroups.com
I have  a test case where I open a new browser instance.
Is it possible to get a reference to the new window in order to select a file for upload.

Thanks for your help in advance!

Adrian Longley

unread,
Mar 4, 2015, 11:10:40 AM3/4/15
to co...@googlegroups.com
On Wed, Mar 4, 2015 at 3:55 PM, Mike Teye <mike...@gmail.com> wrote:
I have  a test case where I open a new browser instance.
Is it possible to get a reference to the new window in order to select a file for upload.

Thanks for your help in advance!

--
You received this message because you are subscribed to the Google Groups "Coypu" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coypu+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mike Teye

unread,
Mar 4, 2015, 11:51:53 AM3/4/15
to co...@googlegroups.com
Thanks for your help Adiel.

The window is a file upload select window and so I get a 
Coypu.MissingWindowException - "Unable to find window: File Upload"

I am using the Chrome driver

My code is as below:

Browser.ClickButton("Browse");
var fileOpenWindow = Browser.FindWindow("Open");
fileOpenWindow.Select("8426.pdf");

The file input box is readonly so I am unable to use the FillIn approach.
Is there any way to fillIn a readonly input field.

Thanks again

Adrian Longley

unread,
Mar 4, 2015, 11:55:38 AM3/4/15
to co...@googlegroups.com
Oh I see. It's a regular file input? Then you can just use FillIn.:


I know you can't type in the field, but coypu/selenium handles this for you. Have you definitely tried this? 

 
Is there any way to fillIn a readonly input field.

Thanks again

--
Reply all
Reply to author
Forward
0 new messages