Menu

#98 asp.net 2 master pages issue (with workaround)

open
nobody
None
5
2014-04-13
2005-11-29
No

I've found that something as simple as this fails with
master pages in asp.net 2

Browser.GetPage(somePage)
Dim newPage As New WebFormTester(Browser)
Dim txtName As New TextBoxTester("txtName", newTeamPage)
txtName.Text = teamName

It seems that master pages appends lots of
indentifiers, so "txtName" is never found.

I'm using the latest code in cvs as of 11/20/2005

I worked around the problem by modifying htmlTagTester,
line 324 to

//if (selector == null) selector = "//*[@id='" + HtmlId
+ "']";
if (selector == null) selector = "//*[contains(@id,'" +
HtmlId + "')]";

This, of course, means that ids must not be generic, or
else you will hit collisions. It also would be (a
little) better if I could have gotten "ends-with" to
work instead of contains.

Anyhow.. very happy with the product.

Thanks!

-Darin

Discussion


Log in to post a comment.