Micro Focus QTP (UFT) Forums
Disabled but Dynamic WinEdit Box - 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: Disabled but Dynamic WinEdit Box (/Thread-Disabled-but-Dynamic-WinEdit-Box)



Disabled but Dynamic WinEdit Box - nikhil.sikka - 01-03-2010

Hi Friends.

In QTP Windows testing i am trying with it's Flights Application.

a. Login.
b. Create New Order.
c. Click Insert Order Button.
d. After Few seconds, there is a disabled text box that displays the order number, i want to capture that order number into the global data sheet. however i am not able to do so. i tried to create a function and tried to display the value of order number generated in msgbox. see code below.

Question 1: Can you help me in using order number to be capture as an output value of my action into the global sheet of the parent action.

Question 2: Please let me know what is wrong with this code below?


Code:
Window("Flight Reservation").WinButton("Insert Order").Click
wait(10)
Sub GetOrderNumber()
     value = Window("Flight Reservation").WinEdit("Order No:").GetROProperty(text)
     msgbox(value)
End Sub

Regards
Nikhil


RE: Disabled but Dynamic WinEdit Box - sreekanth chilam - 01-04-2010

Hi,

Code:
Window("Flight Reservation").WinButton("Insert Order").Click
wait(10)
Sub GetOrderNumber()
   value = Window("Flight Reservation").WinEdit("Order No:").GetROProperty("Text")
      Datatable.value("OrderNumber",dtGlobalSheet")=value
End Sub

Call GetOrderNumber()
msgbox  Datatable("OrderNumber",dtGlobalSheet")

Note: ordernumer generated as an Output will be assigned to RunTime Datatable's GlobalSheet in Test Results