Micro Focus QTP (UFT) Forums
How do you clear default values of java edit box contained within a java table? - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: How do you clear default values of java edit box contained within a java table? (/Thread-How-do-you-clear-default-values-of-java-edit-box-contained-within-a-java-table)



How do you clear default values of java edit box contained within a java table? - shiraz - 12-16-2008

Hi,

I am currently using QuickTest v9.5 and have created scripts for a Java applet application. In the application, I am attempting to clear the default value ('0.00') of a java edit box that is contained within a java table. I can type a new value into the java edit box, but the new
value is typed at the end of the default value which is not what I wanted. The java edit box is only activated after a click, hence it is not captured during record/playback.
I am accessing the edit box via the row no and column no's of the java table.

CODE SNIPPET
Line# 1:
Code:
Browser(DataTable.Value("envlbl", dtGlobalSheet)).Page(DataTable.Value("envlbl", dtGlobalSheet)).ActiveX("Java
Plug-in").JavaApplet("ICFMApplet").JavaDialog("Timeseries data").JavaTable("Select data entry method:_Vol").ActivateRow "#0"

Line# 2:
Code:
Browser(DataTable.Value("envlbl", dtGlobalSheet)).Page(DataTable.Value("envlbl", dtGlobalSheet)).ActiveX("Java
Plug-in").JavaApplet("ICFMApplet").JavaDialog("Timeseries data").JavaTable("Select data entry method:_Vol").ClickCell 0,3

Line# 3 :
Code:
Browser(DataTable.Value("envlbl", dtGlobalSheet)).Page(DataTable.Value("envlbl", dtGlobalSheet)).ActiveX("Java
Plug-in").JavaApplet("ICFMApplet").JavaDialog("Timeseries data").JavaTable("Select data entry method:_Vol").Type  "123"

Line# 4:
Code:
Browser(DataTable.Value("envlbl", dtGlobalSheet)).Page(DataTable.Value("envlbl", dtGlobalSheet)).ActiveX("Java
Plug-in").JavaApplet("ICFMApplet").JavaDialog("Timeseries data").JavaTable("Select data entry method:_Vol").Type micReturn


SOLUTIONS I HAVE ATTEMPTED IN TRYING TO CLEAR DEFAULT VALUES
Solution #1: SetCellData
Result: Unspecified Error
Solution #2: Type micBack three times before line # 3
Result: nothing happens
Solution #3: Defined the edit box object in the Object Repository and attempted to activate the edit box
Result: Run error, cannot identify the object
Solution #4: PressKey "X", micCtrl before line # 3
Result: nothing happens
Solution #5: Adding SelectCell after click cell
Result: Operation cannot be performed

Would very much appreciated any other suggested solutions that I can try.

THANK YOU!


RE: How do you clear default values of java edit box contained within a java table? - Rajashekar Gouda - 12-16-2008

Hi,

Just try to put blank in the edit box before u type ur desiderd value.
exmpl:
Line# 3 :
Code:
Browser(DataTable.Value("envlbl", dtGlobalSheet)).Page(DataTable.Value("envlbl", dtGlobalSheet)).ActiveX("Java
Plug-in").JavaApplet("ICFMApplet").JavaDialog("Timeseries data").JavaTable("Select data entry method:_Vol").Type  ""

or

Line# 3 :
Code:
Browser(DataTable.Value("envlbl", dtGlobalSheet)).Page(DataTable.Value("envlbl", dtGlobalSheet)).ActiveX("Java
Plug-in").JavaApplet("ICFMApplet").JavaDialog("Timeseries data").JavaTable("Select data entry method:_Vol").set ""

Then

Line# 3 :
Code:
Browser(DataTable.Value("envlbl", dtGlobalSheet)).Page(DataTable.Value("envlbl", dtGlobalSheet)).ActiveX("Java
Plug-in").JavaApplet("ICFMApplet").JavaDialog("Timeseries data").JavaTable("Select data entry method:_Vol").Type  "123"

Let me know whether this is working or not

Regards
Raj


RE: How do you clear default values of java edit box contained within a java table? - shiraz - 12-18-2008

Hi Raj

Thank you for your suggestions, I tried them both:

Type ""
Result: nothing seems to happen because the resulted value was still "0.0123"

Set ""
Result: QTP complained 'Operation cannot be performed'

Other things I tried:
1) Type micShiftHome & "123" &micReturn
Result: 0.0123

2) Type micShiftDwn & micHome & micShiftUp & micDel + "1" & micReturn
Result: The cursor went to the very last column of the table row.
But this key combination is what was generated by QTP during low-level recording.