0

処置:WebElement.Click()ChromeとIEのドライバで動作していない

私は次のXPath

WebElement checkBoxSelection = driver.findElement(By.xpath("//*[@id='tblusref']/tbody/tr[1]/td[2]/input")); 
checkBoxSelection.click(); 

私のXPathはまた、クロムの開発者ツールを使用して検証し、正しいとチェックボックスをチェックしたいです、しかし、実行時にそのチェックボックスをクリックしない、と私は

同じ例外を取得していない午前その完璧私はこの問題を解決することができますどのようにその助けてくださいChromeとIE、 で働いていない、Firefoxのドライバで作業

ドライバ依存

<groupId>org.seleniumhq.selenium</groupId> 
      <artifactId>selenium-chrome-driver</artifactId> 
      <version>2.53.1</version> 

<groupId>org.seleniumhq.selenium</groupId> 
      <artifactId>selenium-ie-driver</artifactId> 
      <version>2.42.2</version> 
+0

の可能性のある重複 - ([NGモデルXPathはChromeとIEのドライバで動作しないのチェックボックスをチェック] http://stackoverflow.com/questions/41115126/ng-model- check-the-checkbox-xpath-not-working-in-chrome-and-ie-driver) – Guy

+0

同じ質問を2度はしないでください。 – Guy

+0

@Guy:重複していない、私は以前の質問を編集して、フィードバックを得ていないので、私は現在の問題で新しい質問を提起した – Prabu

答えて

0
try to update to version 3.X 
update the chrome driver also 
i am adding a method that can help u debug 
it highlight the place you click 
(please use shorter path and if u can change it to css selector) 

public void highligh(By cssSelector) { 
     JavascriptExecutor js = (JavascriptExecutor) getDriver(); 
     js.executeScript("arguments[0].style.border='2px groove green'", driver.findElement(cssSelector)); 
    } 
関連する問題