Can Selenium IDE verify text on an XML page

霸气de小男生 提交于 2019-12-13 05:14:01

问题


I have an application that for one of its pages returns an XML string (type text/xml). The result is returned "inline" so that when I load that page in Firefox I see the XML string.

I want to use the Selenium IDE plugin in Firefox to verify that some text is present on this page. However, when I try to do this with the VerifyTextPresent command I get the error Couldn't access document.body. Is this HTML page fully loaded?.

Is it even possible to do this kind of check in Selenium on XML output? If so, how?

Here is a snippet of what the page produces:

<?xml version="1.0"?>
<alerts time_generated="2011-01-20 20:34:01" version="2.00" time_generated_epoch="1295584441">
  <alert>
    <client_updates/>
    <contact_firstname>Brian</contact_firstname>
    ...

回答1:


Selenium does not natively support verifying text present in an XML page. However, there is an assertTextPresentXML extension available.



来源:https://stackoverflow.com/questions/4755436/can-selenium-ide-verify-text-on-an-xml-page

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!