mld has asked for the wisdom of the Perl Monks concerning the following question:

Application is designed with username and password field.

case1: On click of "Login" button without providing username an error icon will get dislpayed as "user name cannot be empty"

<span id="rfvUserName" title="User name cannot be empty."

I need to access the error message and compare.Let me know how can I access the title of span?

Replies are listed 'Best First'.
Re: validating the error message
by Corion (Patriarch) on Apr 17, 2009 at 09:41 UTC

    Do you really think we will make an effort to help you do your day job?

    You could at least show some respect towards us in showing what you've done so far, what the environment is in which you need to achieve your goal, what modules you are using, where the <span> element comes from and so on.

      I am trying to automate the web application. I am using Win32::IEAutomation. For accessing the textBox and other controls

      But I dont know to access the title of span to validate the error message.Because the application is designed in such a way that an error icon is displayed beside the respective field and error message displayed as tool tip of the error icon.

        I guess it's time you learn about HTML, how to retrieve it from Internet Explorer and how to look through it. I guess that's part of your job.

Re: validating the error message
by ig (Vicar) on Apr 17, 2009 at 10:42 UTC

    You can use the content() method of Win32::IEAutomation to get the HTML as a string, then you can use one of the HTML modules to parse this and retreive the error message.

      That is funny :) IE already parsed the html ... IEAutomation returns objects, all he has to figure out is the right combination of method calls... what he'll probably ask next is how to use HTML::Parser :)