Tuesday, May 16, 2006

Selenium IDE and ASP.NET validators

After reading Jess Tedder's praise of Selenium IDE, I went to give it a try. I liked it, thought it was very easy to use and very effective.

There were two problems I had with it: one, that there doesn't appear to be a way to stop a test once it is in progress without closing the IDE (a problem if you accidentally get yourself into a wait state for something that will never happen), and two, that there doesn't seem to be a straightforward way to test for the appearance of ASP.NET validator control indicators and messages on the page.

Validator indicators and messages are rendered on the page, but initially have their style.visibility attribute set to hidden. Indicators appear at the site of the validator control in the page, while messages are commonly dynamically collected displayed in validation summary controls, elsewhere on the page. Selenium has methods to test for the presence of text on a page, but since the messages and indicators are indeed on the page but not necessarily visible, you get a lot of false positives. I tried using methods that looked for attributes of specific elements, but ran into problems because it isn't always possible to predict what the id will wind up being for a control on an ASP.NET page, depending on what it's nested in and how the markup was generated. Indeed, some controls (like the <li> error message elements that are added to validation summary controls during validation) don't even get their own ids. Finding the control by its location rather than its id can be problematic in ASP.NET because since the error messages are added dynamically, you don't necessarily know where in the sequence the list entry with your message will be.*

I'm sure eventually someone will write a Selenium extension that will take care of this -- a text-on-page test that tests for the visibility of the text. It would be nice if it also allowed expressions for the search text. I might even try it myself once I get past my home programming backlog.

* Yes, ideally you'll know exactly which messages to expect and can predict where in the sequence the message you're testing for will fall. But the test you're running might be just for one function generating one message, and not concerned with nor wishing to specify what other validation messages might be visible.

17 Comments:

Blogger Jess Tedder said...

Hey Ann! I'm glad you liked the post. Selenium supports two "asserts" that will help with your visible problem. "assertVisible" and "assertNotVisible" I've used both when working with the vaildation controls.

5/19/2006 8:27 AM  
Blogger ramya raj said...

Wonderful!! this is really one of the most beneficial blogs I’ve ever browsed on this subject. I am very glad to read such a great blog and thank you for sharing this good info with us.Keep posting stuff like this.Best AWS Training Academy in Kanchipuram

7/13/2019 8:05 AM  
Blogger Blessy john said...

Thanks for sharing these niche piece of knowledge. Here, I had a solution for my inconclusive problems & it’s really helps me a lot keep updates…No:1 Software Testing Training Academy in Kanchipuram

7/15/2019 7:43 AM  
Blogger karthik said...

Wonderful article.It is to define the concepts very well.Clearly explain the information.It has more valuable information for encourage me to achieve my career goal.
Best JAVA and J2EE Training Institute in Kanchipuram

7/16/2019 5:27 AM  
Blogger ramya raj said...

Its really an Excellent post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog. Thanks for sharing…No:1 Python Programming Training Academy in Kanchipuram

7/16/2019 6:44 AM  
Blogger rajinikumar said...

Really i enjoyed very much. And this may helpful for lot of peoples. So you are provided such a
nice and great article within this.
Best Web Designing and Development Training Institute in Kanchipuram

7/17/2019 5:16 AM  
Blogger deepa prabu said...

It’s interesting that many of the bloggers to helped clarify a few things for me as Well as giving. Most of ideas can be nice content.…No:1 JAVA Training Academy in Kanchipuram

7/17/2019 7:50 AM  
Blogger mohanraj said...

you done a great work,I’m really impressed with your article, such great & usefull knowledge you mentioned here.
Best Graphic Designing & Multimedia Training Institute in Kanchipuram

7/18/2019 5:30 AM  
Blogger meenaraj said...

Awesome Post! I like writing style, the way you described the topics throughout the post. I hope many web reader will keep reading your post at the end, Thanks for sharing your view.…No:1 Selenium Training Academy in Kanchipuram

7/18/2019 6:53 AM  
Blogger Blessy john said...

Great information, I like this kind of blog information really very nice and more I can easily new skills are develop after reading that post..…No:1 AWS Training Academy in Kanchipuram

7/19/2019 6:56 AM  
Blogger kumaran meena said...

Wonderful blog… You provided very interesting information here. I feel happy to read this post. I hope that you will write many posts like this… Thanks for sharing and Keep updating…..No:1 Software Testing Training Academy in Kanchipuram

7/20/2019 7:00 AM  
Blogger Chris Hemsworth said...

The article is so informative. This is more helpful for our
Learn best software testing online certification course class in chennai with placement
Best selenium testing online course training in chennai
Best online software testing training course institute in chennai with placement
Thanks for sharing.

7/20/2019 7:38 AM  
Blogger karthik said...

This is really too useful and have more ideas from yours. keep sharing many techniques
and thanks for sharing the information.
Best CCNA Training Institute in Kanchipuram

7/20/2019 9:26 AM  
Blogger rajinikumar said...

Wow!! What a interesting blog..Thanks The information which you provided is very much useful and easy to learn as well...keep rocking and updating... looking further..
Best CCNA Training Institute in Kanchipuram

7/22/2019 2:32 AM  
Blogger Blessy john said...

Hi, am a big follower of your blog. I am really happy to found such a helpful and fascinating post that is written in well manner. Thanks for sharing such an informative post. keep update your blog.…..Best Web Designing Training Academy in Kanchipuram

7/22/2019 7:38 AM  
Blogger mano karan said...

This information is impressive; I am inspired with your post writing style & how continuously you describe this topic. After reading your post, thanks for taking the time to discuss this, I feel happy about it and I love learning more about this topic.Regards,
Best tally erp 9 Training Institute in kanchipuram|

7/23/2019 6:13 AM  
Blogger ramya raj said...

Wonderful!! this is really one of the most beneficial blogs I’ve ever browsed on this subject. I am very glad to read such a great blog and thank you for sharing this good info with us.Keep posting stuff like this..…..Best VMware Training Academy in Kanchipuram

7/23/2019 7:34 AM  

Post a Comment

<< Home