How to use the Selenium IDE to validate text on an XML page?

This previously asked question was responsible for using the plugin, but this plugin is no longer supported or even not available. Without using the plugin, how can you check the text on an XML page?

For example, how do you confirm that the URL of the test page is in the sitemap.xml file for your site?

+4
source share
1 answer

Use assertElementPresent in conjunction with xPath:

store "http://yourwebsite.com" baseURL store your/test/page/ test_page_URL open ${baseURL}/sitemap.xml assertElementPresent //*[contains(text(),'${baseURL}/${test_page_URL}')] 

The Selenium IDE is not intended for XML pages, so it took a lot of experimentation before I could figure out how to get xPath to work in order to find the text.

This last line basically says:

Confirm the existence of the string '$ {baseURL} / $ {test_page_URL}' anywhere on the page (with values ​​for the variables baseURL and test_page_URL connected).

+1
source

All Articles