question

rooneysh avatar image
rooneysh asked rooneysh posted

How can I get the GetTable row count?

Hi,

 

I need to find out a swing table's row count, what should I do in the analyze of step "getTable"?

 

row count.JPG

 

Best Regards!

Xiaosong

iTestGUI Testing(Web-Java Swing-etc)
row count.JPG (93.7 KiB)
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

lakshminarayana avatar image
lakshminarayana answered lakshminarayana posted

Hi

Whenever you create a table response map you get a query by name 'rowCount()' in queries view, this would retrieve the number of rows in a table.

Hope this will help you.

Thanks



8 comments
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

rooneysh avatar image rooneysh commented ·

To lakshminarayana,

 

But the response map has been created by iTest automaticly. 

0 Likes 0 ·
rooneysh avatar image rooneysh rooneysh commented ·

Hi,

 

I found out how to do this, I use xpath query  as you can see in bellow picture, and it return the correct count.

4fd99d18.jpg

0 Likes 0 ·
4fd99d18.jpg (3.0 KiB)
sreekanth avatar image sreekanth rooneysh commented ·

By Default, iTest will create the queries automatically as per the response.if you can see in the "Queries view" you will see the rowcount() will give the how many rows you have in your command output.

 

Hope it helps

0 Likes 0 ·
YujieL avatar image YujieL sreekanth commented ·

see attached test case.

 

I save the getTable() response in a variable. Then I use the query command on the variable in conjunction with the rowCount() query. the getTable action automatically generaates a rowCount() query. Look at the queries view.

0 Likes 0 ·
example.fftc (3.8 KiB)
jianguo72 avatar image jianguo72 YujieL commented ·

I tired to use rowcount() to get the row number as well. I also saved the value to one variable. However in another step, I tired to use it with gget. iTest always complained the variable does not exist.

How to fix this issue?

0 Likes 0 ·
sandeepreddynv avatar image sandeepreddynv ♦ jianguo72 commented ·

If you are using the save the variable as global and using it in a same procedure then it will throw the error.

 

We could use the global variable in other procedures by using gget option. If you are trying to use the variable in the same procedure. We need to take it a local variable and then we need to do eval step and then take it in a global variable to use in other procedures.

 

Hope it help!!

 

Regards,

Venkat

0 Likes 0 ·
jianguo72 avatar image jianguo72 sandeepreddynv ♦ commented ·

Thanks.

so in same procedure, I do not need to mark those saved variable in response analysis to "global "?

0 Likes 0 ·
sandeepreddynv avatar image sandeepreddynv ♦ jianguo72 commented ·

Could you please try the below option and see if you could able to take the variable in same procedure:

 

1. Go to General tab of your test case.

 

2. Please check the check box " Force all variables to be global" under Execution behavior.

 

3. Now try to use the global variables in the same procedure.

 

Regards,

Venkat

0 Likes 0 ·
YujieL avatar image
YujieL answered YujieL posted

I don't have an direct answer for you.  Open the Structured Data view.  This view contains the XML version of the mapped response.  You can create an XPath query that tells you how many rows there are. 

1 comment
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

rooneysh avatar image rooneysh commented ·

To Yujie

 

Can you give me an example explain how to query it? 

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.