-
Junior Member
Qtp
Hello All ..
I am new to QTP...I know we can handle an application whose name is frequently changes by using regular expressions..but how?Is there any formate or script for that?
-
Junior Member
Re: Qtp
Hi,
Depends on requirements regular expressions can be used and these are some examples,
This can be used when full word name changing,
\w – its matches to any alphanumeric characters and underscores (A-Z, a-z, 0-9, _).
Example: \w{6}matches abcde4, 1hjdbn, gh3jj_, a_M_yz.
This can be used when beginning or end of the character is changing,
A Period (.) matches any single character of the word except \n.
Example: receive. Here matches received, receives or receive followed by space or single character.
Hope this may helpful for your requirements.
Regards,
Vasanth
-
Expert Member
Re: Qtp
hey Dave,
Adding to what vasnath has jotted down, try using wildcards as well -
You could use ' ? ' and ' * ' as well with expressions.
For instance you want to capture a window name that keeps changing frequently like - Win5786.
The numeric 5786 could keep changing with every refresh operation or every action.
So in such cases, we change the Window name to a regular expression -
Name = "Win*".
This would accept all recognize all windows starting with Win and followed by characters.
Incase you want to use specified character lenght use the ? character.
Cheers
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules