Micro Focus QTP (UFT) Forums
Using regular expression to identify dynamic pages - 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: Using regular expression to identify dynamic pages (/Thread-Using-regular-expression-to-identify-dynamic-pages)



Using regular expression to identify dynamic pages - grave711 - 05-23-2012

Hi,
I'm having a problem getting the browser name and page for a pop up browser.
This is may scenario.
1. Login in the website
2. website will go to inbox in which, the page name is dynamic.
Using the regular expression Browser("micclass:=Browser", "name:=.*").Page("micclass:=Page", "title:=.*"), i did get the page name.
3. clicking the New Message and there will be a pop up browser (there is now 2 browser opened in my desktop).
As i use the same regular expression above, it give me an error which says it is not unique..

Please help me with this.

Thanks in Advance Smile




RE: Using regular expression to identify dynamic pages - sshukla12 - 05-23-2012

Hi,
Since ur page is dynamic but there must be some pattern for its name, use regexp for that pattern instead of .*
This might help u.

Regards,
Sankalp


RE: Using regular expression to identify dynamic pages - grave711 - 05-23-2012

Thanks Sir Sankalp,
By the way, can you give me the exact regular exp. I'm still not familiar in using all regular exp.
The first browser name is "Inbox [123]" and the second browser name is "New Message".
Thanks Sir,
By the way, can you give me the exact regular expression that can be used in identifying 2 browser. I'm still not familiar in using all reg exp.
My 1st browser name is "Inbox[123]"
My 2nd browser name is "New Message"


RE: Using regular expression to identify dynamic pages - srikanthqtp - 05-23-2012

Hi

Try to use creation time to indentify browsers, it will be easy

Coming to ur Q:

You didnt mention which part is dynamically changing, First of all observe closely and find out which part is changing dynamically and which part is constant then after try to use regularexpressions.


RE: Using regular expression to identify dynamic pages - sshukla12 - 05-23-2012

Hi,

What u have told us is bit different, these 2 pagaes are totaly different in their name , nothing as such dynamic. So it will be better to add these pages seperately in OR and go head and 4 the pages which have some comman strings in thier name , go for regex for them.

Regards,
Sankalp


RE: Using regular expression to identify dynamic pages - grave711 - 05-24-2012

Solve it, thanks to you guys..
I did use the creation time and it works..
Thanks again. Smile
as per research for my problem, creating a description to identify the unique property of the browser will also solve the problem.
Code:
Set oDesc = Description.Create
oDesc("version").Value = "internet explorer.*"
Set oIE = Desktop.ChildObjects(oDesc)



RE: Using regular expression to identify dynamic pages - sshukla12 - 05-25-2012

Gerat to hear that problem is resolved.

Regards,
Sankalp


RE: Using regular expression to identify dynamic pages - abhishekjain_87 - 08-07-2012

HI All,

Can any one help me with the Syntaxe's for

1) creation time
2) Indexes
3) Location

In descriptive programming