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.

30 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 mani said...

Great post.Thanks for one marvelous posting! I enjoyed reading it;The information was very useful.Keep the good work going on!!
Best Graphic Designing Course Training Institute in kanchipuram|

8/26/2019 1:55 AM  
Blogger ramya raj said...

Quite Interesting post!!! Thanks for posting such a useful post. I wish to read your upcoming post to enhance my skill set, keep blogging. No:1 Linux Training Academy in Kanchipuram

8/26/2019 8:36 AM  
Blogger meenaraj said...

I would like to thank you for your nicely written post, its informative and your writing style encouraged me to read it till end. Thanks No:1 Tally Training Academy in Kanchipuram

8/27/2019 7:46 AM  
Blogger mano karan said...

Nice and good blog. It is very useful for me to learn and understand easily. Thanks for sharing your valuable information and time. Please keep updating...
Best Web Technologies Course Training Institute in kanchipuram|

8/28/2019 6:33 AM  
Blogger kumaran meena said...

Excellant post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it..No:1 Cloud Computing Training Academy in Kanchipuram

8/28/2019 7:37 AM  
Blogger rajinikumar said...

There was very wonderful information and that's great one. I really appreciate the kind words, thanks for sharing that valuable information.
Best C++ Course Training Institute in kanchipuram|

8/29/2019 5:03 AM  
Blogger Anu Ram 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..No:1 Selenium Automation Training Academy in Kanchipuram

8/29/2019 8:02 AM  
Blogger ramya raj said...

Thanks for your informative article. Your post helped me a lot in understanding the career prospects in search engine optimization..No:1 JAVA J2EE Training Academy in Kanchipuram

8/30/2019 8:00 AM  
Blogger bharathidasan said...

Superb i really enjoyed very much with this article here. Really its a amazing blog i had ever read. I hope it will help a lot for all. Thank you so much for this amazing posts and please keep update like this excellent blog.
Best Web Technologies Course Training Institute in kanchipuram|

8/30/2019 10:27 AM  
Blogger deepa prabu said...

Great post! I am actually getting ready to across this information, It’s very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well..No:1 Python Programming Training Academy in Kanchipuram

8/31/2019 6:57 AM  
Blogger sandhiya said...

You have done a great job, really the concept of big data was superb, its very interesting and easy to understand also.. Keep updating such a nice blog..
Best CCNP Course Training Institute in kanchipuram|

8/31/2019 8:07 AM  
Blogger meenaraj said...

Nice and good blog. It is very useful for me to learn and understand easily. Thanks for sharing your valuable information and time. Please keep updating....No:1 Selenium Automation Training Academy in Kanchipuram

9/03/2019 6:21 AM  
Blogger kumaran meena 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 Python Training Academy in Kanchipuram

9/04/2019 7:48 AM  
Blogger mani said...

The information you have here is really useful to make my knowledge good. It is truly supportive for us and I have accumulated some essential data from this blog.
Best JAVA and J2EE Course Training Institute in kanchipuram|

9/05/2019 5:13 AM  
Blogger Anu Ram said...

The blog is very useful, interesting and informative. thank you for sharing the blog with us. keep on updating….No:1 Dot Net Training Academy in Kanchipuram

9/05/2019 8:25 AM  
Blogger karthik said...

Wonderful blog.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 Graphic Designing Course Training Institute in kanchipuram|

9/06/2019 5:39 AM  
Blogger kumaran meena said...

Superb. I really enjoyed very much with this article here. Really it is an amazing article I had ever read. I hope it will help a lot for all. Thank you so much for this amazing posts and please keep update like this excellent article.thank you for sharing such a great blog with us. expecting for your.….No:1 Linux Training Academy in Kanchipuram

9/06/2019 7:41 AM  
Blogger mano karan said...

Your Blog is really awesome with helpful post..keep updating such an excellent post with us..
Best CCNA Course Training Institute in kanchipuram|

9/07/2019 2:04 AM  
Blogger deepa prabu 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 Training Academy in Kanchipuram

9/07/2019 8:20 AM  
Blogger rajinikumar said...

This is really a great post. Thank you for taking time to provide us some of the useful and exclusive information with us. Keep on blogging!!
Best CCNA Course Training Institute in kanchipuram|

9/09/2019 2:50 AM  
Blogger bharathidasan said...

Great blog.you put Good stuff.All the topics were explained briefly.so quickly understand for me.I am waiting for your next fantastic blog.Thanks for sharing.
Best Tally erp9 Course Training Institute in kanchipuram|

9/10/2019 2:37 AM  
Blogger sandhiya said...

Nice..You have clearly explained about it ...Its very useful for me to know about new things..Keep on blogging..
Best JAVA and J2EE Course Training Institute in kanchipuram|

9/11/2019 2:58 AM  
Blogger mani 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 CCNA Course Training Institute in kanchipuram|

9/12/2019 2:16 AM  
Blogger meenaraj said...

Excellent post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.….No:1 AWS Training Academy in Kanchipuram

9/12/2019 8:24 AM  
Blogger divi said...

thanks for your details it's very use for my works web design company in velachery

9/12/2019 8:37 AM  
Blogger karthik said...

Great post.Thanks for one marvelous posting! I enjoyed reading it;The information was very useful.
Best Best Web Designing and Development Course Training Institute in kanchipuram|

9/13/2019 2:45 AM  
Blogger deepa prabu said...

very nice blogs!!! I have to learning for lot of information for this sites...Sharing for wonderful information. Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing.No:1 LINUX Training Academy in Kanchipuram

9/13/2019 8:11 AM  
Blogger bharathidasan said...

great doing. and i happy to visit your blog to know about this wonderful information. thanks for sharing. keep updating.
Best Best Web Designing and Development Course Training Institute in kanchipuram|

9/14/2019 2:11 AM  
Blogger Blessy john said...

Great blog.you put Good stuff.All the topics were explained briefly.so quickly understand for me.I am waiting for your next fantastic blog.Thanks for sharing..No:1 CCNA Training Academy in Kanchipuram

9/14/2019 8:10 AM  

Post a Comment

<< Home