Capture runtime fax order number - 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 Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners) +--- Thread: Capture runtime fax order number (/Thread-Capture-runtime-fax-order-number) |
Capture runtime fax order number - sqtlearner - 01-04-2012 Hi everyone.. I have a small problem... When we record a test with launch flight reservation application + Login + insert order + fax order + close.. then when we play this test, it fails... I realise that this happens because when we please the test then the order number increases.. i.e if order number was 100 while recording then it increases to 111 when we play the test again. Can someone advise how I can capture the run time fax number so that when I replay my test then it run as passed. (using parameterizing and data table) Also I am a beginner to QTP so please do not advise how to do it by writing scripts.. i wont be able to understand .... RE: Capture runtime fax order number - ravi.gajul - 01-04-2012 To do so...go to object repository--->Under Flight Reservation window, click on Fax Order No.100( number could be different in your repository).On the right hand side after you click on Fax Order No.100 you would see the properties of that dialog box.User regular expression .* for text property. To do so click on the value of text property then click on the icon <#>..."value configuration options" dialog box pops up..in the text box change Fax Order No.100 to Fax Order No.* and select the check box Regular Expression.YOu would see another pop up "Do you want to add the backslash(\) before each special character in order to treat it literally..click on "No".Then click on ok and re run the test Please dont hesitate to post ..if you didn't get this.. RE: Capture runtime fax order number - sqtlearner - 01-04-2012 Thanks a lot Rajiv... I just figured it out using regular expression and it is working fine.. just like u guidedme what I want is that I want to capture run time order number in my data table... then want to configure the run time order number with the "Fax order No. " in Object repository. I have summerised what I did below -: 1 > recorded test with login + insert order + fax + close 2 > went to "inser Order" line in expert view so that the correct flight booking window is highlighted in Active Screen. 3 > In active screen right clicked on "order number" box and selected " Insert Output Value" 4 > in object selection window "WinEdit : order num" > ok 5 > In output value property box.. selected text property... modify 6 > In Output Option window.. output type = datatable, Name = ord_num, location in data table = global 7 > Insert statement after currnet step. My intension behind these steps was that the run time order number can be captured in data table under "ord_num" coloumn. Now I want that this run time order numebr which is being captured under coloumn "ord_num' of datatable can be assigned to "Fax Order No." object in Object repository so that when I run the test, the run time order number gets configuured with "Fax Order No." in my object repository. I guess I am trying to do it a complicated way.. but was just wondering possibly how this can be done RE: Capture runtime fax order number - ravi.gajul - 01-04-2012 yeah you can achieve that using setTOProperty(set Test Object property) Code: iNum=DataTable.Value("ord_num",Global) 'Retrieving order number from data table |