spain wrote:When testing webforms, what's the easiest way to programmatically?
1. match an element in the current browser window by it's id.
2. check if it's innerText contains a certain string?
I tried to figure it out by the code generated from the ui test builder, but I couldn't even figure out how to get the current browser window.
Thanks.
From the question's phrasing it appears you are using the eValid structural testing methods on this particular case.
You've actually got it pretty close to right, but as you have found, the US test builder (nee the test recording engine) doesn't necessarily know about the level of detail down to the ID tag value.
Instead, your best bet is to "record from life" and then hand-modify the script.
For example, where you have a FollowLink, the replacement is a sequence:
IndexSet 0 -- to start at the top of the page
IndexFindElement -- to locate the required ID tag
IndexElementClick -- to click on the DOM element you've just found.
Or, if you wish, on that current page, you can use ValidateSelectedObjProperty to validate the valud of a property with the name you specify, e.g. innerText.
If you check in the eValid documentation you'll find a number of these standard passages already worked out for you.
eValid Technical Support