Unable to verify the Text Present.
I am using verifyTextPresent in Selenium IDE and it is throing me an error. I have used following code:
verifyTextPresent link=Selenium - Web Browser Automation
When used firebug found the following code in html:
<a class="l" onmousedown="return rwt(this,'','','','1','AFQjCNHCelhj_BWssRX2H0HZCcP qhgBrRg','','0CC8QFjAA','','',event)" href="http://seleniumhq.org/" saprocessedanchor="true" original_target="http://seleniumhq.org/" verdict_1d4bhmc="OK" onclickstat_1d4bhmc="SERP_CL_GR">
- Web Browser Automation
since Selenium Web Browser Automation is on different lines it is giving me error. Tried the same in SeleniummRC also but script is failing.
what's the application URL?
Why don't you do something like driver.findElement(By.xpath(" ")).getText, store that in a variable and then do AssertEquals(expected,actual). Your actual is going to be the value from the browser and expected is going to the variable "Selenium - Web Browser Automation".
You should/can prefer to Selenium WebDriver. That would be a great work.
Use 'contains' in xpath - instead of exact string match. E.g., //a[contains (text(), 'Web Browser Automation']
Use XPath with "contains" text - //a[contains(text(), 'Web Browser Automation')]