Micro Focus QTP (UFT) Forums

Full Version: Regular Expression for a Complex Browser Title
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hii,

I have a File Download Dialog present in a browser.

I want to perform Browser().Dialog().Activate

But, the Browser Title is a complex string such as

https://mywebsite.com/mylocation/dcDocum...Revision=1

The following items in the title are dynamic.
1.mylocation
2.00457
3.00002.txt (can be 00002.pdf even)
4.textDoc.txt
5.1

Please suggest a way of identifying the browser object using regular expression.

Thanks,

Preet
Hi Ankur,

I even face the same condition and need your response on this.
This is particularly for when we click on a link which opens a Dialog containg "Save" and "Cancel" buttons and a Browser behind the Dialog having dynamic title.
This should work.

Code:
^https?\://mywebsite.com(/\S*)

This should match http or https, the domain name can not change, then any non-whitespace in the path to the end.
try:

Browser("title:=.*).