首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >使用Selenium IDE从定位器获取文本

使用Selenium IDE从定位器获取文本
EN

Stack Overflow用户
提问于 2015-11-18 19:41:13
回答 1查看 452关注 0票数 0
代码语言:javascript
运行
复制
    <br>
    <br>
    To add new COT click on "Add New COT"
    <div class="stepandbutton">
        <div class="globalbuttoncell">
            <a class="buttonlink blockpage" onclick="javascript:addnewcot();" href="#">Add New COT</a>
        </div>
    </div>
    <input id="ComingFromForm" type="hidden" value="ComingFromForm" name="ComingFromForm">
    <input id="priorCOT" type="hidden" value="" name="priorCOT">
    <input id="rtncode" type="hidden" value="false" name="rtncode">
    <input id="refresh" type="hidden" value="NO" name="refresh">
    <input id="PDate" type="hidden" value="" name="PDate">
    <table>
        <thead>
            <tr>
                <th align="center"> *Trade Class</th>
                <th align="center">*Description</th>
                <th>Category </th>
                <th>Exclude from AMP</th>
                <th>Exclude from AMP 5i</th>
                <th>Exclude from ASP</th>
                <th>Exclude from BP</th>
                <th>Exclude from NFAMP </th>
                <th>Exclude from Texas </th>
            </tr>
        </thead>
        <tbody>
            <tr class="odd">
                <td align="center">
                    <input id="COT" class="data" type="text" value="" style="width:100px;" name="COT">
                </td>
                <td align="center">
                    <input id="Desc" class="data" type="text" value="" style="width:250px;" name="Desc">
                </td>
                <td align="center">
                    <select id="COTCategory" class="data small" name="COTCategory">
                </td>
                <td align="center">
                <td align="center">
                <td align="center">
                <td align="center">
                <td align="center">
                <td align="center">
            </tr>
        </tbody>
    </table>
</form>
<br>
<br>

我只需要验证“”要添加新COT,请单击第三行中的"Add New COT“”。我已尝试使用// is包含(text(),“要添加新COT,请单击"Add new COT”)。但是它显示了定位器不是found.Please的错误,建议了另一种验证方法。

EN

回答 1

Stack Overflow用户

发布于 2015-11-24 00:27:01

这是丑陋的,但可以“工作”:

代码语言:javascript
运行
复制
<tr>
    <td>verifyText</td>
    <td>//body</td>
    <td>*To add new COT click on "Add New COT"*</td>
</tr>

但是正如上面的评论者提到的,你不想要br元素。您想要定位的是您没有提供的元素,该元素位于您附加的代码之上。那将是最好的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33779124

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档