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

Capture first cell in table and use that value for next validation

5 Answers 59 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Julie
Top achievements
Rank 1
Julie asked on 27 May 2014, 08:44 PM
I have a table with three columns and numerous rows. The first column contains dates that are hyperlinks.

Is there a way to:
A) click the first cell in a table regardless of the date that is displayed 
and then
B) use the date that was just clicked to dynamically verify that the page displayed contains that date (the page displayed is a report for that date).

So you click on May 27 in the cell, and the next page displays "Daily Schedule for Tuesday, May 27th, 2014" But I don't care that it's specifically May 27...just want the first cell and then to match the two dynamically.

Thanks for the help.

5 Answers, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 30 May 2014, 11:35 AM
Hi Julie,

Please see this video for a demonstration.

I have modified the find expression to click on the first cell and extract the value into variable.

Let me know if this helps.

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Julie
Top achievements
Rank 1
answered on 24 Jun 2014, 05:21 PM
What is the first think you are clicking on? Are you right clicking on the "Navigate to..." step?
0
Julie
Top achievements
Rank 1
answered on 24 Jun 2014, 05:27 PM
Okay, that was supposed to be "thing," not "think." And is there supposed to be audio with the video? I do not have any audio.
0
Miguel
Top achievements
Rank 1
answered on 24 Jun 2014, 09:01 PM
Hi Julie,
The best way I've found to do something like this requires you to add that cell to your project elements and make its find logic as generic as possible to ensure no matter what the TextContent is, it will always refer to the first cell in the table. Once you have the cell properly mapped you can use the cell contents to create an anchor you can click on:

​HtmlAnchor anch = null;
anch = (~~YOUR ELEMENT~~).ChildNodes[0].As<HtmlAnchor>();
anch.ScrollToVisible(ArtOfTest.WebAii.Core.ScrollToVisibleType.ElementTopAtWindowTop);
anch.MouseClick(ArtOfTest.WebAii.Core.MouseClickType.LeftClick, 0, 0, ArtOfTest.Common.OffsetReference.AbsoluteCenter);

Note that in this example I am assuming the actual anchor in the DOM is the first child element of the cell where the tags in the DOM follow this structure: tr->td->a (row->cell->anchor)

Hope this helps.

0
Boyan Boev
Telerik team
answered on 27 Jun 2014, 10:07 AM
Hello Julie,

Yes, I am clicking on Navigate step to load the page.

Then I make the find expression as generic as possible.

@Miguel, thank you for you input. We really appreciate it.

Thank you!

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Julie
Top achievements
Rank 1
Answers by
Boyan Boev
Telerik team
Julie
Top achievements
Rank 1
Miguel
Top achievements
Rank 1
Share this question
or