FindWindow with Contains?

379 views
Skip to first unread message

circa.1741

unread,
Jun 19, 2013, 1:26:58 AM6/19/13
to co...@googlegroups.com
It would be nice if FindWindow() can work with contains instead of the full text.

Or, is it able to?

Thanks

Adrian Longley

unread,
Jun 19, 2013, 3:03:05 AM6/19/13
to co...@googlegroups.com
On 19 Jun 2013, at 06:26, circa.1741 wrote:

It would be nice if FindWindow() can work with contains instead of the full text.

Or, is it able to?

No. Any particular reason you can't predict the window title exactly?

Thanks

--
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/groups/opt_out.
 
 

sanjaya athukorala

unread,
Jul 31, 2013, 12:08:27 AM7/31/13
to co...@googlegroups.com
Hi Adiel,

I have a scenario where the pop up window title is generated from the server side with the time stamp. As an example my pop up window title is 'XXXXX report 2010/07/31 13.45.21.xls

So, i obviously need to have something like 'FindWindow can work with contains'.

Or else, do you see any other way to get this done?

Thanks.
Regards,
Sanjaya.

sanjaya athukorala

unread,
Jul 31, 2013, 1:15:50 AM7/31/13
to co...@googlegroups.com
Hi Circa,

I also have a same scenario that i cannot validate the pop up with title name? i also prefer to have something like 'FindWindow() can work with contains'.

So, have you sorted out this issue? if so how?

Thanks.
Regards,
Sanjaya.

Adrian Longley

unread,
Jul 31, 2013, 4:44:36 AM7/31/13
to co...@googlegroups.com
On Wed, Jul 31, 2013 at 5:08 AM, sanjaya athukorala <sanj...@gmail.com> wrote:
Hi Adiel,

I have a scenario where the pop up window title is generated from the server side with the time stamp. As an example my pop up window title is 'XXXXX report 2010/07/31 13.45.21.xls

Ok, I'm sold.

Coypu 0.19.0 - relased just now - has this feature as you requested. Hope it does what you need!
Adrian

sanjaya athukorala

unread,
Jul 31, 2013, 5:13:51 AM7/31/13
to co...@googlegroups.com
Hi Adrian,

Thanks for the latest update.

I have ran my test scenario with coypu 0.19.0 version. But i still cannot use FindWindow with partial title name.

My intellisense says, i have the right coypu version.
 // Summary:
        //     Find an open browser window or tab by its title or name. If no exact match
        //     is found a partial match on title will be considered.

I have attached the dialog i'm testing and the code snippet in which you may see how i tried to capture dialog.

Thanks.
Regards,
Sanjaya.
immediate_windowlog.JPG
popUpDialog.JPG

Adrian Longley

unread,
Jul 31, 2013, 5:32:57 AM7/31/13
to co...@googlegroups.com
Sanjaya,

This is not a browser window, but the firefox modal download dialog.

You won't be able to automate this window with WebDriver (Coypu).

Coypu can help you dowload the file though, assuming you can determine the URL of the file to be downloaded. There is the following method you can call on a BrowserSession:

/// <summary>
/// Saves a resource from the web to a local file using the cookies from the current browser session.
/// Allows you to sign in through the browser and then directly download a resource restricted to signed-in users.
/// </summary>
/// <param name="resource"> The location of the resource to download</param>
/// <param name="saveAs">Path to save the file to</param>
public void SaveWebResource(string resource, string saveAs)


Hope this helps
Adrian

sanjaya athukorala

unread,
Jul 31, 2013, 6:42:30 PM7/31/13
to co...@googlegroups.com
Thanks Adrian,

I will check this out.

Regards,
Sanjaya.

md ibrahim rashid

unread,
Jan 14, 2015, 7:51:41 AM1/14/15
to co...@googlegroups.com
Hello,

You can use browser.FindWindow("substring of title").
It will provide you matching browser window.

Regards,
Ibrahim
Reply all
Reply to author
Forward
0 new messages