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?
Printable View
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?
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
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