Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
hresgil
Posts : 5
Join date : 2011-12-20

Issue with HTML Escape code like  Empty Issue with HTML Escape code like

Mon Feb 13, 2012 7:17 pm
I would be very much obliged if any one can help me with the following issue:


I’m testing a web application with sites on different local languages.
For one of my tests, I have to click on a menu item which I can only access by its description, (it has not a unique id)
selectProvince(String hotelProvince)


selenium.click("css=a:contains('" + hotelProvince + "')");

The menu Item is of following format: ProvinceName + “, “ + countryName

Sometimes either name could be compassed of two or more words.



If in the htlm page, those words are separated by normal space, my test works just fine, but in cases the space has been replaced by this escape code, In this case my test fails as not

Ayia'&'nbsp;Napa, Chipre
(99 hoteles)

For example one of May test looks for a description containing ‘Ayia Napa’

In one site it works just fine as a matching item is found.

But in the another site it fails because the description found is ‘Ayia'&'nbsp;\Napa’ which does not match the expected value. (please remove the ' in front and after &, added just to make scape code visible)

have spent more than a week doing research and trying to figure out how to format the expected value string to match what is on the site’s code, but have been unable to find the right solution.

I would appreciate if someone could help me with a working example.
Back to top
Permissions in this forum:
You cannot reply to topics in this forum