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

Can't click tabstrip link in test playback

3 Answers 43 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Shea
Top achievements
Rank 1
Shea asked on 10 Sep 2014, 08:08 PM
During recording, I login, then click on a tab (from a Telerik tabstrip). The .tstest file shows click TimeSheetLink. But when I play back the recording, it hangs trying to locate that link, even though I can clearly see it in the browser. The html for the link looks like this: <a class="k-link" href="#/Timesheets">Timesheets</a>. I get the same result if I put a verify exists/visible, etc.

Is there a trick to clicking anchors? It seems to record the step properly.

3 Answers, 1 is accepted

Sort by
0
Shea
Top achievements
Rank 1
answered on 10 Sep 2014, 08:10 PM
I also tried executing that step on it's own ('execute selected steps') and it still can't locate the element.
0
Shea
Top achievements
Rank 1
answered on 10 Sep 2014, 09:22 PM
I have found out what the problem is. Basically the generated Pages.g.cs get generated incorrectly. The TimeSheetsLink property gets generated like this:

public ArtOfTest.WebAii.Controls.HtmlControls.HtmlAnchor TimeSheetsLink
{
    get
    {
        return Get<ArtOfTest.WebAii.Controls.HtmlControls.HtmlAnchor>("tagname=a", "href=/Timesheets");
    }
}

The fix is to change it to this:
public ArtOfTest.WebAii.Controls.HtmlControls.HtmlAnchor TimeSheetsLink
{
    get
    {
        return Get<ArtOfTest.WebAii.Controls.HtmlControls.HtmlAnchor>("tagname=a", "href=#/Timesheets");
    }
}
Note the hash in front of /Timesheets.

Another work around is to "edit in code" the click action, and then change 
TimeSheetsLink.Click(false);

to
Get<ArtOfTest.WebAii.Controls.HtmlControls.HtmlAnchor>("tagname=a", "href=#/Timesheets").Click(false);

We have many links/buttons that have hrefs with hashes in the (angular routing). So I don't want to have to perform one of these work arounds after every recording sessions.

I am going to have to suspend our companies trial period for now.



0
Boyan Boev
Telerik team
answered on 15 Sep 2014, 02:14 PM
Hi Shea,

I am sorry you are running into this problem.

I have already logged a bug report on this which you can track here.

The workaround is to change the find rule in the find expression from "is exactly" to "contains".

Thank you for your understanding.

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
Shea
Top achievements
Rank 1
Answers by
Shea
Top achievements
Rank 1
Boyan Boev
Telerik team
Share this question
or