Mr.Question™ 2020-04-20 19:19 采纳率: 0%
浏览 793

Selenium无法定位Form嵌套table的元素。使用了css,xpath等8种形式都不行

Selenium无法定位Form嵌套table的元素。使用了css,xpath等8种形式都不行

前端代码片段如下(采用了灵魂脱敏技巧)

<body>
<div class="body">
    <div class="project-con">
    <h2 class="clearfix project-tit">
    <span class="f-lefts">1234</span>
    </h2>
 <div class="body">
    <div>
      <div 
        <h3 

        </h3>
        <div class="XXX">
          <form id="form" action="XXX.htm" method="POST">
          <table width="96%" border="0" cellspacing="0" cellpadding="0" class="project-table" style="margin-left:2px;">
            <tr>
                <td class="project-font" id="c">4123</td>
                <td width="11.5%" id="d"><div class="input-project">
                    <input type="text" class="input-pro-input"  name="123123"/>
                    </div>
                </td>
                <td class="XXX" >&nbsp5123123:</td>
                <td width="11.5%"><div class="input-project">
                    <input type="text" class="input-pro-input"  name="123123123"/>
                    </div>
                </td>
              <td class="project-font" width="11.5%">1234123:</td>
              <td width="11.5%">
                <div class="input-project"><input type="text" name="123" class="input-pro-input" id="1234444"/>
                                           <input type="hidden" name="123123" class="input-pro-input" id="123"/>
                </div>
              </td>
              <td class="project-font" >1234123:</td>
              <td width="11.5%">
                <div class="input-project"><input type="text" name="123123123" class="input-pro-input" id="ffffff"/>
                                           <input type="hidden" name="1234" class="input-pro-input" id="ssssss"/>
                </div>
              </td>
            </tr>
            <tr>

现在想定位如下这个叫name="123123123"id="ffffff"的元素怎么都不行

<div class="input-project"><input type="text" name="123123123" class="input-pro-input" id="ffffff"/>

使用xpath等各种方式都不行。

  • 写回答

4条回答 默认 最新

  • 风一样的男子& 2020-08-20 19:46
    关注

    检查一下xpath,在浏览器中验证一下是否唯一,

    评论

报告相同问题?

悬赏问题

  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
  • ¥15 乘性高斯噪声在深度学习网络中的应用
  • ¥15 运筹学排序问题中的在线排序
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败