Java 元素自动向左滚动,当单击元素时元素被隐藏

Java 元素自动向左滚动,当单击元素时元素被隐藏,java,selenium,selenium-webdriver,testng,Java,Selenium,Selenium Webdriver,Testng,Selenium版本:2.44 操作系统:Windows 7 64位 浏览器:Firefox和IE-10 在我的应用程序中有一个网页,我在其中填写了一些详细信息,该网页有几个更新按钮和一个滚动条。当我运行selenium脚本时,当selenium尝试向下滚动并在页面的中间或底部查找元素时,页面将其位置移到左侧。这反过来会隐藏要搜索的元素,并且测试运行失败。此问题不会手动发生 我认为出现这个问题是因为自动滚动并执行单击操作 我的代码执行类似于ifselenium.findElementCreate

Selenium版本:2.44 操作系统:Windows 7 64位 浏览器:Firefox和IE-10

在我的应用程序中有一个网页,我在其中填写了一些详细信息,该网页有几个更新按钮和一个滚动条。当我运行selenium脚本时,当selenium尝试向下滚动并在页面的中间或底部查找元素时,页面将其位置移到左侧。这反过来会隐藏要搜索的元素,并且测试运行失败。此问题不会手动发生

我认为出现这个问题是因为自动滚动并执行单击操作


我的代码执行类似于ifselenium.findElementCreateOrgAuthRecordRadioButton.isSelected和&selenium.findElementLocApproveRadioButton.isSelected的操作 { 硒检查无线电‌UttonCorgRadioBTN,Consts.ELEMENT_XPATH; selenium.clickl ocOrgmasterBtn,Consts。‌​元素XPATH; }

HTML代码片段如下所示


请分享该元素的HTML片段,以及迄今为止您所处理的代码。帮助我们帮助你。。谢谢能否请您详细说明,以及是否可以添加有帮助的代码段..我的代码执行诸如ifselenium.findElementCreateOrgAuthRecordRadioButton.isSelected和selenium.findElementLocApproveRadioButton.isSelected之类的操作{selenium.checkRadioButtonlocOrgradioBtn,Consts.ELEMENT_XPATH;selenium.clicklocOrgmasterBtn,Consts.ELEMENT_XPATH;}HTML代码片段类似于请将上述代码以正确的格式放入您的问题中。将其放在注释中是不可理解的。在问题中添加了代码和代码片段。@Subh
        <div class="orgLocInfoHeading clear b" id="orgLocDiv">
          Organization and Location
        </div>
        <div class="orgLocInfoBody  fl">
          <div class="orgDataAuth  fl">
           <div class="orgSelection fl">
            <table class="domTable"  cellpadding="0" cellspacing="0">
                  <tr>
                    <td>  <input type="radio"  class="approvedFlag" id="cborgApproved" name="orgRadio"></td>
                    <td>Organization Approved</td>
                  </tr>
                   <tr>
                    <td> <input type="radio"  id="cborgNeedinfo" name="orgRadio"></td>
                    <td>Need more info for Org Auth</td>
                  </tr>
             </table>

              <div class="FormFieldContainer  noMargin clear" style="width:190px;">
                    <div class="FormElementLabelContainer lblOrgNamePOR dInline fl">
                         <label> </label>
                    </div>
                    <div class="FormElementContainer font12 fl dInline">
                     <div class="FormElementBorderContainer">
                            <div id="orgStatus"></div>
                     </div>
                    </div>
                </div>
            </div>