Pages

Monday, September 13, 2010

Regular Expression in QTP for Windows Application Flight

regular expression concept

Open Flight Reservation window-->open any order I have taken order no:-->the following window opens

clip_image002clip_image004

start recording

now go to file-->Fax order-->enter fax number-->click on send-->stop recording

clip_image006the following code generates

Window("Flight Reservation").Activate

Window("Flight Reservation").WinMenu("Menu").Select "File;Fax Order..."

Window("Flight Reservation").Dialog("Fax Order No. 2").ActiveX("MaskEdBox").Type "1212121212"

Window("Flight Reservation").Dialog("Fax Order No. 2").WinButton("Send").Click

step2:- Right click on the ("Fax Order No. 2")-->go to “object properties”

clip_image009

click on the above symbol the below window opens

clip_image012clip_image017now remove 2 and give *. and select regular expression clip_image019 Fax Order No.*.-->click on OK the below change you can see clip_image021click on OK

RUN the test -->it will run

Now open another order number like Order No:7 now the details of fax are new but still your script will run as you have applied the concept of “Regular expression”

No comments:

Post a Comment