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

How do you search with dynamically changing html containers?

1 Answer 43 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 22 Aug 2012, 06:02 PM
So something that I've always had a bit of an issue with is how to deal with dynamically changing containers, like tables, lists, etc.

As of now when I fill out a form, and that form adds content to a specific table, I use a code behind class and a customer HTML searching tool I wrote to search that table for strings that I am looking for. This is a bit troublesome, because it means that I'm required to create a code-behind class for every test that has to verify data.

Another option that I noticed is I can create a unique element that wont be the same so the search params will be something along the lines of:
tagname = td
InnerText = TheStringUniqueToTheTestIAmRunning

The problem with this is that this will eventually create hundreds, if not thousands of elements creating a massive project file, not to mention from my experience test studio standalone or the vs plugin don't handle sorting elements very well and often crash because of it.

So what I'm hoping for is some other options that are a little simpler, that can be unique to a test and not require a code behind... all suggestions are appreciated!!

Cheers
Jon

1 Answer, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 27 Aug 2012, 09:25 PM
Hello Jon,

I apologize for the delay getting back to you on this. One recommendation is to use our DOM Explorer and the Build Verification to deal with dynamic content in tables when you have no idea which row the data to be verified will appear. I demonstrate this technique in this video: http://screencast.com/t/CZtJGPGy. A similar approach can be used to verify that content no longer exists. The tough part is that the content has to exist at the time of recording then modify the verification into a Not Exists verification.

Greetings,
Cody
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Jon
Top achievements
Rank 1
Answers by
Cody
Telerik team
Share this question
or