Refresh Table at runtime to get Rowcount

Ranorex Spy, Recorder, and Studio.
cld2403
Posts: 6
Joined: Thu Mar 10, 2011 9:50 am

Refresh Table at runtime to get Rowcount

Post by cld2403 » Tue Aug 13, 2013 9:35 am

Hi,

I have a problem with the refreshing of a table during runtime.
I have a GUI where I put something in, press "search" and than a table will be filled.
The table is tracked (in repository) but without rows (in empty case). When I want to know the row count of this table during runtime I always get 0 as result.

I think that there is no refreshing or rather the program doesn't know that there was a change...
How can I find out that information?

I tried:
table.rows.count();
Host.Local.Find<Row>("complete path").Count;
I also tried make a click into the table and than get the count but it's always 0
I also tried only track the container where the table is included but same result - 0

By the way, I write the testcases by myself in Visual Studio 2012 C# and the Table is a Telerikcontrol.

Do your have any advice for me?
thx
best regards
Claudia

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Refresh Table at runtime to get Rowcount

Post by krstcs » Tue Aug 13, 2013 12:56 pm

Have you tried tracking the cells AFTER updating the search?

Doing this might allow you to see how the table is structured after the update, which may be different than how it is structured before the update.

This will also let you make sure your XPaths are correct for your search.
Shortcuts usually aren't...

cld2403
Posts: 6
Joined: Thu Mar 10, 2011 9:50 am

Re: Refresh Table at runtime to get Rowcount

Post by cld2403 » Tue Aug 13, 2013 1:19 pm

I can't track after updating because I'm the program is running in that moment!

As I wrote above I tried to find rows with the "find" command and the complete tracking path but it is always 0.
I think that during the running test, the repositiory doesn't recognize that something has changed in the table... for this I wanted to know if it is posible to do a refresh of the tracked items or something else

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Refresh Table at runtime to get Rowcount

Post by krstcs » Tue Aug 13, 2013 1:29 pm

If you have SPY running, you can move the mouse over what you want to track and hit "Ctrl-LWin" to activate Instant Tracking.

You can do this while your AUT is running.

ETA: Also, my earlier suggestion was about the AUT, not your test, I'm not sure I made that clear.
Shortcuts usually aren't...

cld2403
Posts: 6
Joined: Thu Mar 10, 2011 9:50 am

Re: Refresh Table at runtime to get Rowcount

Post by cld2403 » Tue Aug 13, 2013 2:02 pm

thx but I don't know how this can help me with my problem

the tracking path is correct, when the screen starts and the table is already filled with rows I can access them with table.rows.count and I get the correct count
but when the table is filled during runtime I cannot access the rowcount because it will not be recognized that something has changed ...

and I cant do what your suggest to me because it is an autoamted test on the screen so the pc is locked because mouse and keyboard will be used and I can't access them

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Refresh Table at runtime to get Rowcount

Post by Support Team » Fri Aug 16, 2013 5:34 pm

Hi,

I think user "krstcs" wants you to verify if Ranorex is able to track the elements within your table after it was refreshed.

What would happen if you re-create/re-search the table in code?

Regards,
Markus
.
Image