This is a migrated thread and some comments may be shown as answers.

Grid Cell Verification

7 Answers 140 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mark
Top achievements
Rank 1
Mark asked on 03 May 2013, 06:59 PM
I have a question related to verifying cells of data. As nn example I have the following scenario.

1. Data entry screen to input data, some in text fields and some in dropdown. Data in these fields could change based on user requirements. Data is extracted at the time of entry to have a matcher during verification.
2. A  data screen with a grid and rows of data.
3. I want to be able to verify the data in the cells in the grid and compare to data that was entered in the first screen(via extracted data).
The problem I'm running into is that when I have a row like such:
<tr class="rgRow Clickable Highlight"  id="ctl01_ctl00_bodyContent_removedForPrivacy_100__0">
        <td>asdfsdf</td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
    </tr>

The matching "find element" logic ends up being the data in the cell.
For example it would have a filter for TextContent that contains asdfsdf and tagname of td.
Find logic
Expression = TextContent=^asdfsd,tagname=td
FindLogic = [tagname 'Exact' td] AND [TextContent 'StartsWith' asdfsdf]
This would possibly work if the find logic could use the datadriven value, but I don't see any way of doing this.

This match will only work if that is the data in that cell. If I have a randomly generated string that gets input, this will break the test.
So I'm wondering if it' is possible to target a specific column given I am looking at a specific row?(row 0(based on the id) col = 0 or something) I've seen some postings where this appears to be able to be done via scripted steps, but that would add a bit of work to the process of creating the tests as I have quite a few areas where I run into this case.


7 Answers, 1 is accepted

Sort by
0
Mark
Top achievements
Rank 1
answered on 03 May 2013, 07:23 PM
I accidentally posted this in the Test Studio express section, should be in the regular Test studio section. If possible can this be moved over to that section?
0
Accepted
Rodney
Telerik team
answered on 08 May 2013, 09:16 PM
Hi Mark,

Thank you for contacting Telerik. Based on what you described, it sounds like you will need to 
Extract the data from the input field and then use the extracted variable in a Data Driven Find Expression to locate the value and verify it. Notice after our 2012 R2 release, this is all possible without code).  The only caveat is that you will have to manually enter the data variable into the “Add coded data variable” field when setting your find expression.

Please let me know if this helps. If not, will need more information about your test scenario. Please provide a copy of your test and access to your application (or a demo site that uses the same features). 
 

All the best,
Rodney
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Mark
Top achievements
Rank 1
answered on 08 May 2013, 11:21 PM
Thanks for the tip and I'll try it out shortly. 

I actually was looking at this problem again before I saw your reply and may have also come up with one possible solution, though it does require a coded step to complete and may be a bit tedious in the long run but here is an example scenario and steps I was planning to take.

Ex: Grid has 2 columns, title and comment.
1. Start Add data to a grid process.(essentially clicking a button to get to the data input area)
2. Generate a random value.
3. Tack on random value to string that will be used for the field being tested(ex: titleCol_1f3c)
4. Save data to a variable
( steps 2,3, and 4  will be part of  the same coded step.)
5. Enter string_randval data into the field being tested.
6. repeat steps 3,4,and5 for comments using the random value first generated.
7. Save data.
8. Verify data in grid is accurate based on saved variable data and target of field.
The target(find expression) of the field would be "tagname"-isExactly-"td" and "TextContent"-startsWith-"titleCol"

Let me know your thoughts on this approach.
Thanks!
0
Rodney
Telerik team
answered on 13 May 2013, 11:59 PM
Hello Mark,

Thank you for the update. Although your solution may work, I agree that it may be tedious to work with in the long run. Typically, if something can be done without code, I suggest going that route.

Since Test Studio allows you to data-drive your find expressions, I would go the UI route unless at some point adding code becomes the more straight-forward solution.

All the best,
Rodney
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Mark
Top achievements
Rank 1
answered on 11 Jun 2013, 11:54 PM
I was able to try this finally, and I have it working. I'm curious though, will the datasource be necessary in the future versions of test studio in order to bind a variable or will there be an option to bind to a variable as an option(if a variable is available)?

Thanks again for your help.
0
Rodney
Telerik team
answered on 14 Jun 2013, 07:41 PM
Hello Mark,

I’m happy you were able to get this working. I've filed a feature request for this functionality. You can follow this link to check the status of the request and vote for its inclusion in future releases.  

Take Care,
Rodney
Telerik
Free summer webinars on advanced web automation tactics hosted by Jim Holmes & Adam Goucher.
Reserve your seat today!
0
Zeeshan
Top achievements
Rank 1
answered on 14 Jul 2013, 10:19 AM
Woow great coding thanks for sharing with us
Tags
General Discussions
Asked by
Mark
Top achievements
Rank 1
Answers by
Mark
Top achievements
Rank 1
Rodney
Telerik team
Zeeshan
Top achievements
Rank 1
Share this question
or