I have a tricky one!
I am trying to test an image button click in Selenium. This is the HTML code:
<a href="/targetPage.do?status=onOrder&"><img src="/img/buttons/showOnOrder.gif" alt="Show 'On Order'"/></a>
I completely agree that having the single quote in the alt text is not ideal/good, but for the purposes of this test, I can’t currently change the code.
I have tried the following
selenium.click("//img[@alt=\"Show 'On Order'\"]");
selenium.click("xpath=//img[@alt='Show ''On Order''']");
But no joy. Please, please, please make my day and suggest the syntax I can use that works.
Try this :