enter image description here私はウェブページ上の画像をクリックしようとしています。このイメージの XPathがある - // * [ID @ = 'のGridView-1018'] /テーブル/ TBODY/TR [3]/TD [7]/DIV/A/IMGselenium webdriverの画像をクリックするには
HTMLコードは -
<td class=" x-grid-cell x-grid-cell-gridcolumn-1016 ">`<div class="x-grid-cell-inner " style="text-align: center; ;">`<a href="http://demo.webshopondemand.com/Shop/AbzorbDevelopment/Store/" target="_blank">`<img src="/admin/templates/images/house.png" style="background-color: transparent;"/>`
ここにすべて下記の方法で試みたが、同じエラーMSGました "要素を見つけることができません: - 。
driver
.findElement(By
xpath
(" .//*[@id= 'gridview-1018']/table/tbody
/tr [3]/td [7]/div/a/img "))。クリック();WebElement temp = driver.findElement(By.xpath( "// img [(@src、 '/ admin/templates/images/house.png')]")); temp.click();
WebDriverWait
待機=新しいWebDriverWait
(ドライバ、60); wait.until(ExpectedConditions.visibilityOfElementLocated
(By.cssSelector
( "x-grid-cell-inner.a.img"))));driver.findElement
(By.cssSelector
( "X-グリッドセル-`inner.a.img"))。(クリック)
4. driver
。 findElement
(By.cssSelector`( "a [href = 'AbzorbDevelopment']"))。
ありがとうございました!
返信いただきありがとうございます。 WebElement shop = driver.findElement(By.xpath( "// * @ @ id = 'gridview-1018']/table/tbody/tr [3]/td [7]/div/a/img ")))); \tアクションactions = newアクション(ドライバ); \t actions.moveToElement(ショップ).click()。perform();受け取ったエラーmsg:{"method": "xpath"、 "selector": "// * [@ id = 'gridview-1018']/table/tbody/tr [3]/td [7]/div/a/img "} – Rupali
はうまくいきましたか? –
受信したエラーmsg:{"method": "xpath"、 "selector": "// * [@ id = 'gridview-1018']/table/tbody/tr [3]/td [7 ]/d iv/a/img "} – Rupali