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.


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 ram chinna said...

Best Digital Transformation Services | DM Services | Austere Technologies

3/22/2018 1:07 AM  
Blogger masi said...

Very good informative article. Thanks for sharing such nice article, keep on up dating such good articles.


3/26/2018 1:26 AM  
Blogger AUSTERO said...

What an interesting information, Thanks for sharing.

Best Mobility Services | Austere Technologies

3/28/2018 2:41 AM  
Blogger AUSTERO said...

wow...nice blog, very helpful information. Thanks for sharing.

Best IT Security Services | Austere Technologies

4/09/2018 5:10 AM  
Blogger SachinVarshan said...

I believe there are many more pleasurable opportunities ahead for individuals that looked at your site.
aws training in Chennai

4/12/2018 7:44 AM  
Blogger raj kumar said...

Those guidelines additionally worked to become a good way to
recognize that other people online have the identical fervor like mine
to grasp great deal more around this condition.

white label website builder

4/14/2018 4:14 AM  
Blogger Inigo joseph said...

Thanks a lot very much for the high your blog post quality and results-oriented help. I won’t think twice to endorse to anybody who wants and needs support about this area.
java training in chennai

4/18/2018 1:35 AM  
Blogger mithra R said...

Thank you a lot for providing individuals with a very spectacular possibility to read critical reviews from this site. great blog.selenium training in chennai

4/19/2018 8:18 AM  
Blogger ajay ak said...

Thanks for the useful information of software testing courses, give more updates on software testing development, First time I visit your blog really nice, I bookmark your blog here after a daily visit. Learn software testing course in Chennai

4/27/2018 12:33 AM  
Blogger priyanka said...

I and my friends were going through the nice, helpful tips from the blog then the sudden came up with an awful suspicion I never expressed respect to the website owner for those secrets.
Best Python training Institute in chennai

5/02/2018 6:22 AM  
Blogger desh said...

Wow...What an excellent informative blog, really helpful. Thank you.
Best Commerce College in Hyderabad | Avinash College Of Commerce

5/28/2018 7:11 AM  
Blogger austere said...

Great article, really very helpful content you made. Thank you, keep sharing.

Software Testing | Austere Technology

6/01/2018 3:44 AM  
Blogger satheesh sutharapu said...

Excellent information you made in this blog, very helpful information. Thanks for sharing.

chartered accountant | Avinash college of commerce

7/02/2018 7:42 AM  
Blogger avinash said...

Nice blog with excellent information. Thank you, keep sharing.

chartered accountant course in Hyderabad | Avinash college of commerce

7/05/2018 2:04 AM  

Post a Comment

Links to this post:

Create a Link

<< Home