亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

[Selenium]How to click on a hidden link ,mov

系統 1984 0
      <table id="_paid_19" class="GOMainTable" cellspacing="0" cellpadding="0">

<tbody>

<tr>

<tr>

<td style="
      
        overflow:hidden
      
      ;">

<div class="GOBodyMid" style="
      
        overflow: hidden
      
      ; width: 625px; height: 334px;">

<div class="GOPageOne">

<table class="GOSection" cellspacing="0" cellpadding="0">

<tbody>

<tr>

<tr class="GODataRow " style="height: 26px;" onmousemove="Grids[3].ARow=Grids[3].Rows["AR1"];Grids[3].ASec=0;">

<td style="width:0px;height:0px"></td>

<td class=" GOClassReadOnly highlight-tbl HoverClass GOText GOCell HideCol3displayName" colspan="2" style="">
      
        Automation Smoke test Template
      
      </td>

<td class=" GOClassReadOnly highlight-tb HoverClass GOHtml GOCell HideCol3editPencil" colspan="2" style="">


      
        <div class="edit-Pencil"></div>
      
      

</td>

<td class=" GOClassReadOnly highlight-tb b_r HoverClass GOHtml GOCell HideCol3deleteIcon" colspan="2" style="">

<td class=" GOClassReadOnly highlight-tb b_r HoverClass GODate GOCell HideCol3dateModified" colspan="2" style="">8/11/2014</td>

<td class=" GOClassReadOnly highlight-tb b_r HoverClass GOText GOCell HideCol3owner" colspan="2" style="">Rachel Lv</td>

<td class=" GOClassReadOnly highlight-tbr HoverClass GOText GOCell HideCol3permission" colspan="2" style="">Read Only</td>

<td class=" HoverClass GOHtml GOCellEmpty GOEmpty HideCol3_ConstWidth"> </td>

</tr>


    

?場景:需要找到Table中的某一行,然后找到這行的鉛筆圖標,點這個鉛筆圖標會出來下拉菜單,然后在下拉菜單中點擊Open

剛開始寫腳本的時候,按照以往的方式會報這樣的錯誤: "Element is not currently visible and so may not be interacted with"

這個元素在界面上是可見的,也通過正則表達式唯一匹配到了,可是在Click的時候就是不行。

后來查閱資料,發現這個元素的父元素是 hidden 的。

原文如下:

Selenium determines an element is visible or not by the following criteria (use a DOM inspector to determine what css applies to your element, make sure you look at computed style):

  • visibility != hidden
  • display != none (is also checked against every parent element)
  • opacity != 0 (this is not checked for clicking an element)
  • height and width are both > 0
  • for an input, the attribute type != hidden

Your element is matching one of those criteria. If you do not have the ability to change the styling of the element, here is how you can forcefully do it by using Actions in the code.

后來我是這樣解決的,可以成功運行了。

      Actions action =new Actions(driver);

WebElement pencilIcon = page.getPencilIcon(templateName);

action.moveToElement(pencilIcon).click();

		

WebElement menu = page.getMenu();

action.moveToElement(menu).build().perform();

Assert.assertTrue(menu.isDisplayed(),"Cannot find the menu");

		

WebElement open = page.getOpenMenu();

open.click();


    

?

[Selenium]How to click on a hidden link ,move to the drop down menu and click submenu


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 亚洲国产精品综合欧美 | 日韩免费高清一级毛片在线 | 欧美香蕉网 | 亚洲国产成人超福利久久精品 | 久久精品亚洲精品国产色婷 | 老司机久久精品 | 青青青国产色视频在线观看 | 亚洲夜夜操 | 日本二三区 | 欧美久久综合网 | 热久久国产精品 | 国产日韩欧美在线一区二区三区 | 亚洲一区欧美日韩 | 国产草| 任我鲁精品视频精品 | 91精品国产综合久久婷婷 | 日本一级毛一级毛片短视频 | 色狠狠一区二区三区香蕉蜜桃 | 2019天天干天天操 | 九九色网站 | 久久精品中文字幕免费 | 亚洲精品国产字幕久久vr | 麻豆精品国产免费观看 | 国产在线美女 | 99久久一香蕉国产线看观看 | 欧日韩美香蕉在线观看 | 亚洲一区二区三区四区 | 狠狠叉| 我想看一级黄色毛片 | 国产自产拍精品视频免费看 | 五月天亚洲婷婷 | 天天色天天操天天 | 天天色天天射天天操 | 国产高清不卡一区二区三区 | 免费的拍拍视频在线观看 | 日本a在线 | 精品 日韩 国产 欧美在线观看 | 久操免费在线 | 九九性视频 | 黄片一级毛片 | 色噜噜狠狠一区二区三区 |