Best way to search by text in a gridview

Class library usage, coding and language questions.
puntapret
Posts: 34
Joined: Fri Sep 14, 2012 11:05 am

Re: Best way to search by text in a gridview

Post by puntapret » Fri Jan 10, 2014 5:49 pm

The table/gridview in Silverlight has 250 lines, it's just that using Ranorex Spy or Snapshot, i can only see 19, if i scroll the grid, it will show the next lines, so i think there are no problem with the database.

That's why i can't seem finding a way to get a count of the total.

WebElement in silverlight object will work ?

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

Re: Best way to search by text in a gridview

Post by krstcs » Fri Jan 10, 2014 7:19 pm

I "think" WebElement will work for SL, but last time I did SL was over a year ago, so I'm a bit foggy.


My question about the database was more about you doing queries on the data directly from inside Ranorex, not about your SUT seeing the DB.

I have direct access to our SUT database from my Ranorex system so I can validate (and manipulate if necessary) data in my tests. I would recommend this as it allows you to validate more easily that the system is storing and reading the data correctly.
Shortcuts usually aren't...

puntapret
Posts: 34
Joined: Fri Sep 14, 2012 11:05 am

Re: Best way to search by text in a gridview

Post by puntapret » Wed Jan 15, 2014 10:23 am

I can assure you that the database works correctly and it returns 250 lines to the silverlight application.

But hélas using ranorex spy on the currently visible gridview, i can only view 19 lines, and i have to scroll down using scroll bar to see the rest of the lines.

So, at this time, i still can not find a way to determine the total count of lines in my gridview, without scrolling down to the end of line, and getting out of the loop of clicking the scrollbar to check if i'm at the end of line is more complicated.

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

Re: Best way to search by text in a gridview

Post by krstcs » Wed Jan 15, 2014 2:47 pm

I understand that the SUT/DB is working correctly together, that was not my point.

So, let me rephrase the database issue a bit since I didn't do a good job the first time. :D

Would you be able to implement a datareader in Ranorex (i.e. inside your test project) that could read directly from your database to determine the number of rows that the table should show?

This way, you could have Ranorex read from the DB and find the number of records it should be searching through without relying on the visual representation in your SUT.

So, it would work like this:

1. Ranorex connects to the DB.
2. Ranorex queries the DB for the number of rows available to the table in the SUT.
3. Ranorex "walks" through the rows in the table view until it either (a) finds the record you need, or (b) gets to the end of the view (based on the information from 2. above).

Does that make sense?

I've been doing this so long that sometimes what I think makes perfect sense is just jibber-jabber... :D
Shortcuts usually aren't...