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

TextContent Verification Difference between IE and Firefox

4 Answers 52 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Garry
Top achievements
Rank 1
Garry asked on 06 Jan 2011, 12:00 AM
I am having an issue where a verification has different results between IE and Firefox. The Below verification failure is from Firefox where as IE does not have an issue. I looked at the Browser Source, they both look the same. In the Browser, neither show the text with the carriage return displayed, actually they both show the text as what is expected.

<LOG>
Overall Result: Fail
'1/5/2011 1:52:52 PM' - 'Fail' : 1. Verify 'TextContent' 'Contains' 'Password is too weak. Password must be at least 8 characters long. Password must contain at least 1 punctuation characters. Password must contain at least 1 numbers. Password must contain at least 1 upper case characters. Password must contain at least 1 lower case characters.' on 'PasswordIsDiv'
------------------------------------------------------------
Failure Information:
~~~~~~~~~~~~~~~
Content.TextContent of 'PasswordIsDiv' does not match!

   Match Type: 'Contains'
   Expected Result: 'Password is too weak. Password must be at least 8 characters long. Password must contain at least 1 punctuation characters. Password must contain at least 1 numbers. Password must contain at least 1 upper case characters. Password must contain at least 1 lower case characters.'
   Value at time of failure: 'Password is too weak. Password must be at least 8 characters long.
Password must contain at least 1 punctuation characters.
Password must contain at least 1 numbers.
Password must contain at least 1 upper case characters.
Password must contain at least 1 lower case characters.'
</LOG>


Thanks,
Garry

4 Answers, 1 is accepted

Sort by
0
Keaegan
Telerik team
answered on 06 Jan 2011, 09:13 PM

Hi Garry,

I was able to reproduce this type of symptom only when I had a very specific HTML setup. If I setup the "PasswordIs" div as follows:

<body>
<div name="PasswordIs">Password is too weak. Password must be at least 8 characters long. 
Password must contain at least 1 punctuation characters. 
Password must contain at least 1 numbers. 
Password must contain at least 1 upper case characters. 
Password must contain at least 1 lower case characters. 
</div>
</body>

This may not look odd, but there is a non-breaking space at the end of every line in the above HTML. IE automatically converts this space to the proper markup (&nbsp;) and displays it accordingly. However, Firefox needs it listed as the correct markup (&nbsp;) or will have difficulty with locating the object/text.

This would mean one of two options:

  1. Recreate the HTML so that there are no spaces or special returns at the end of the line (not-recommended unless you are the one that controls the HTML as well)
  2. Set the current verification you have to be IE only (to run against IE only), and make a second verification for getting Firefox to work correctly. You can do this by setting up shorter verifications that all occur in within the test (a verification for each line). 
We can try to help you with getting this verification setup, but will need to see a copy of the problem HTML exactly as it is for the page source (this way we can see what is causing Firefox the issue).

All the best,
Keaegan
the Telerik team

Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
0
Garry
Top achievements
Rank 1
answered on 06 Jan 2011, 10:19 PM
Is there a way to detect which browser is running the test?

If so, then I can do an If statement that would have different verifications for the correct browser.

Thanks.
0
Cody
Telerik team
answered on 11 Jan 2011, 08:27 PM
Hi Garry,

Yes there is. Check out this KB article for details.

All the best,
Cody
the Telerik team
Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
0
Mark
Top achievements
Rank 1
answered on 13 Jul 2012, 09:07 PM
Tags
General Discussions
Asked by
Garry
Top achievements
Rank 1
Answers by
Keaegan
Telerik team
Garry
Top achievements
Rank 1
Cody
Telerik team
Mark
Top achievements
Rank 1
Share this question
or