Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Reading Value from Java Table
#1
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi All,

I have a javatable in which there are many values.Every time My QTP script is run, I would like to select a value from Javatable which has decription like "Interest"(say).How can I read Values in Java table and so that at the time of running of script,it seraches for "Interest" in Javatable and selects that cell.[/align]
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
[/u]Hi Arjun,

Use "GetCellData" & "SelectCell" methods.

Syntax:
object.GetCellData(Row, Column)

Syntax:
object.SelectCell Row, Column

Check out the below example & implement accordingly.

Example:

Code:
Expected_Value="test"
RC=JavaWindow(..).JavaTable("Inter-cell spacing:").GetROProperty("Rows")
For i=1 to RC
     Actual_Value=JavaWindow(..).JavaTable("Inter-cell spacing:").GetCellData(i, 1)
     If (Expected_Value=Actual_Value) Then
        JavaWindow(..).JavaTable("Inter-cell spacing:").SelectCell i, 1
        Exit for
    End if
Next
Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
Thanks for the reply.It worked
Reply
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
How can i compare an empty string in the above case ? I want to skip reading data from cells which are empty. thanks for the reply.
Reply
#5
Solved: 11 Years, 3 Months, 3 Weeks ago
Is there any way we can directly get the value of the row containing perticular value,Without traveresing the whole table everytime.
E.g

If in a table row 3 and column "operations" contains a value "insert",then is there a way we can get the row of the cell containing data insert directly without using cell by cell search?
Reply
#6
Solved: 11 Years, 3 Months, 3 Weeks ago
Please check whether your webtable object supports below mentioned method.
Code:
object.GetRowWithCellText (Text, [Column], [StartFromRow])

Reply
#7
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi kotaramamohana,

I am working on javaTable and object.GetRowWithCellText is not supporting.
Its showing errror.
Could you please suggest some other option?
In my project numerous times I have to do it and it takes lot of time to search cell by cell.
Reply
#8
Solved: 11 Years, 3 Months, 3 Weeks ago
Any suggestions ppl?
Please respond,as this would avoid lot of time in my project.
Reply
#9
Solved: 11 Years, 3 Months, 3 Weeks ago
(05-22-2012, 06:24 PM)Shridevi.Salagare Wrote: Any suggestions ppl?
Please respond,as this would avoid lot of time in my project.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Reading Global Sheet's DataTable Value Bhuvana 0 1,634 01-05-2020, 10:03 PM
Last Post: Bhuvana
  Reading data from excel sheet serenediva 1 9,597 03-03-2017, 10:07 AM
Last Post: vinod123
  QTP not reading all properties ishan.mahajan@adp.com 2 2,490 05-04-2016, 10:50 PM
Last Post: supputuri
  Case changes while reading values from inbuilt datatables krishnakittu03 3 2,964 04-28-2015, 11:34 AM
Last Post: kbhargava505
  Reading and writing is the same text file poulomi21b 2 6,083 07-08-2014, 12:39 PM
Last Post: poulomi21b

Forum Jump:


Users browsing this thread: 6 Guest(s)