Micro Focus QTP (UFT) Forums
Regular Expression for a Complex Browser Title - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Regular Expressions (https://www.learnqtp.com/forums/Forum-UFT-QTP-Regular-Expressions)
+--- Thread: Regular Expression for a Complex Browser Title (/Thread-Regular-Expression-for-a-Complex-Browser-Title)



Regular Expression for a Complex Browser Title - preet4u007 - 03-04-2010

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/dcDocumentRetrieve.asp?FileName=Docmanager\ArchivedDocuments\Doc00457.Rev00002.txt&BrowserAction=Save&SaveAsName=textDoc.txt&CheckOutRevision=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


RE: Regular Expression for a Complex Browser Title - PrabhatN - 03-25-2010

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.


RE: Regular Expression for a Complex Browser Title - jsknight1969 - 03-25-2010

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.


RE: Regular Expression for a Complex Browser Title - markQA - 02-13-2011

try:

Browser("title:=.*).