Micro Focus QTP (UFT) Forums
Selecting a cell from Javatable at RUN time - 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: Selecting a cell from Javatable at RUN time (/Thread-Selecting-a-cell-from-Javatable-at-RUN-time)



Selecting a cell from Javatable at RUN time - arjun.singh - 11-20-2009

Hi All,

I have a javatable.After searching for a text in the table,for the row where I have found the text,I want to select its column(which is basically a button),but I am unable to do so.
I havw written following code.

Code:
intSchCount =  JavaWindow("EclipseEJ").JavaDialog("Online Credit Agreement").JavaTable("Select products:").GetROProperty("rows")

Scheme = DataTable("Scheme",dtLocalSheet)

For i = 0 to intSchCount-1
Sch=JavaWindow("EclipseEJ").JavaDialog("Online Credit Agreement").JavaTable("Select products:").GetCellData(i,"A")
                    
If (Sch=Scheme) then
JavaWindow("EclipseEJ").JavaDialog("Online Credit Agreement").JavaTable("Select products:").SetCellData "#i","C","1"
                               Exit for
end if
Next


**************************

I am getting following error:
The operation cannot be performed
Line (126):
Code:
"JavaWindow("EclipseEJ").JavaDialog("Online Credit Agreement").JavaTable("Select products:").SetCellData i,"C","1"".
**********************************

What wrong am I doing?What is the other way to select the column?[/align]


RE: Selecting a cell from Javatable at RUN time - sreekanth chilam - 11-20-2009

Try with the below code:

Code:
intSchCount = JavaWindow("EclipseEJ").JavaDialog("Online Credit Agreement").JavaTable("Select products:").GetROProperty("rows")

Scheme = DataTable("Scheme",dtLocalSheet)

For i = 0 to intSchCount-1
Sch=JavaWindow("EclipseEJ").JavaDialog("Online Credit Agreement").JavaTable("Select products:").GetCellData(i,"A")

If (Sch=Scheme) then
JavaWindow("EclipseEJ").JavaDialog("Online Credit Agreement").JavaTable("Select products:").[b]ChildItem(i,"C","JavaButton",0).Click[/b]Exit for
end if
Next



RE: Selecting a cell from Javatable at RUN time - arjun.singh - 11-23-2009

****************************
Thanks for your effort and time.
It is not the child item.The code doesnt help Sad


RE: Selecting a cell from Javatable at RUN time - sreekanth chilam - 11-23-2009

Apolozies Arjun.
ChildItem method is not applicable for JavaTable, it is applicable for SAPTable(SAP-Web),WebTable

will revert to you if I have a solution.


RE: Selecting a cell from Javatable at RUN time - arjun.singh - 11-26-2009

Any help on this!!!!


RE: Selecting a cell from Javatable at RUN time - sreekanth chilam - 11-26-2009

Hi ,

Hope JavaTable record mode in "Advanced Java Options" dialog box (Tools > Options > Java tab > Advanced button) is set to "Context-Sensitive".

Could you paste the code generated if record an operation of selecting a column in JavaTable.


RE: Selecting a cell from Javatable at RUN time - ppero16 - 12-08-2009

Hi Arjun,

I had a similar problem a while ago. QTP couldn't recognize objects (combo boxes) in JavaTable cells. I solve it with using keyboard to select combo value.
Try something like:



Code:
JavaWindow("EclipseEJ").JavaDialog("Online Credit Agreement").JavaTable("Select products:").ClickCell i, 1

JavaWindow("EclipseEJ").Type  micReturn
JavaWindow("EclipseEJ").Type "1"
JavaWindow("EclipseEJ").Type  micReturn

You can record keyboard input using low level recording.

Hope this helps or at least gives you some ideas...


RE: Selecting a cell from Javatable at RUN time - simbolla - 05-07-2013

I am facing same issue in QTP 11.0 with Java Jide (swing) application , its not clicking the particular cell in javatable.
Code:
JavaWindow("EclipseEJ").JavaDialog("Online Credit Agreement").JavaTable("Select products:").ClickCell i, 1
JavaWindow("EclipseEJ").JavaDialog("Online Credit Agreement").JavaTable("Select products:").DoubleClickCell i, 1

What could be reason for this?????