欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

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

系統 1778 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條評論
主站蜘蛛池模板: 欧美日韩午夜精品 | 欧美一区高清 | 日韩深夜福利视频 | 色精品一区二区三区 | 亚洲精品欧美一区二区三区 | 欧美一级黄色片在线观看 | 亚洲福利 | 欧美猛妇色xxxxxbbbb | 国产久视频观看 | 亚洲午夜精品一区二区三区 | 国产免费A片好硬好爽好深小说 | 日本高清视频免费在线观看 | 97理论三级九七午夜在线观看 | 成人深夜视频在线观看 | 插入综合网 | 欧美一区二 | 麻豆av免费观看 | 爱草在线 | 久久久国产精品免费A片蜜臀 | 午夜在线亚洲男人午在线 | 精品国产一区二区在线 | 青青草视频免费观看 | 欧美一级片手机在线观看 | 色情综合色情播五月 | 91资源在线观看 | 欧美a∨一区二区三区久久黄 | 色九月 | 中文精品久久 | 韩国资源视频一区二区三区 | 欧美aⅴ片 | 亚洲欧美日韩在线 | 亚洲精品国产电影 | 涩涩操 | 人人曰| 日本欧美中文字幕 | 国产内谢 | 91久久艹 | 免费精品一区二区三区在线观看 | 奇米色影| 欧美第5页 | 天天综合亚洲 |