Wierd whitespace character in RanoreXpath
Posted: Mon Oct 10, 2011 3:06 pm
Hello all,
I have this issue with my AUT whereby the inner text value of a certain element contains a whitespace character that I am unable to account for in my tests.
The following is an example of the code used to produce the RanoreXpath for the element:
When the value 'Next Week' is passed in the value parameter, a RanoreXpath like this is produced:
Problem is, an exception is thrown because this RanoreXpath yields no results... when I use the Spy tool to bring up the available values for the innertext attribute of the div I am looking for, the value 'Next Week' appears. This therefore produces the exact same RanoreXpath as the one shown above.
Why were these seemingly identical RanoreXpaths yielding different results?
To find out, I popped them both in notepad++ and used the 'Show All Characters' button (the one that reveals carriage return and whitespace characters) to see if there was any difference. At first there was not, however when I changed the character encoding from ANSI to UTF-8, notepad++ revealed this wierd whitespace character inbetween 'Next' and 'Week'. A screenshot of notepad++ revealing this is attached.
This character is obviously being produced by the AUT. With that in mind, How do I account for this? I need to pass in different values on the fly i.e. I cannot hard code this whitespace character in my tests...
Cheers in advance.
I have this issue with my AUT whereby the inner text value of a certain element contains a whitespace character that I am unable to account for in my tests.
The following is an example of the code used to produce the RanoreXpath for the element:
Code: Select all
DivTag divValue = Repository.VosDomXpath + "//div[@id~'dropdown']//div[@innertext='" + value + "']";
Code: Select all
/dom[@domain='46.51.166.61']//div[@id~'dropdown']//div[@innertext='Next Week']
Why were these seemingly identical RanoreXpaths yielding different results?
To find out, I popped them both in notepad++ and used the 'Show All Characters' button (the one that reveals carriage return and whitespace characters) to see if there was any difference. At first there was not, however when I changed the character encoding from ANSI to UTF-8, notepad++ revealed this wierd whitespace character inbetween 'Next' and 'Week'. A screenshot of notepad++ revealing this is attached.
This character is obviously being produced by the AUT. With that in mind, How do I account for this? I need to pass in different values on the fly i.e. I cannot hard code this whitespace character in my tests...
Cheers in advance.