2017-03-17 16 views
0

ボタンをクリックする必要があり、私は両方のケースを使用しているが、どれも私のために働いていない は、私はIEのボタンをクリックする必要があり

driver.findElement(By.xpath("//button[text()='Existing Customer']")).click(); 

または

driver.findElement(By.xpath("//*[contains(text(), 'Existing Customer')]")).click(); 

または

WebElement obj = driver.findElement(By.xpath("//button[text()='Existing Customer']")).click(); 

Actions act = new Actions(driver); 
act.moveToElement(obj).build().perform(); 

HTML Image

+0

それはドロップダウンだ私には思えます。以下の情報を提供することができます:1.より多くのHTML DOMを提供する。 2.モーダルドロップダウンであることを確認できますか? 3.ドロップダウンのスクリーンショットを提供します。 – DebanjanB

答えて

0

"button"タグの代わりに* symbolを使用できます。これは任意のタグを表すことができます。

driver.findElement(By.xpath("//*[text()='Existing Customer']")).click(); 

[または]

WebElement obj = driver.findElement(By.xpath("//button[text()='Existing Customer']")); 

Actions act = new Actions(driver); 

act.doubleClick(obj).build().perform(); 
関連する問題