2017-08-31 158 views

回答

0

我解決了我的情況下創建一個WebElement對象

IWebElement thing; 

然後我給它的價值。

thing=crome.FindElements(By.TagName("a"))[3]; 
thing.SendKeys("\n"); 

「\ n」是您在選擇元素時按下回車鍵。

0

FindElementsByTagNameRemoteWebDriver方法。隨着ChromeDriver你需要使用

crome.FindElements(By.TagName("a")); 
+0

如何在Chrome上選擇第三個標籤? – Aritzbn

+0

@AritzBello帶索引,就像你的問題一樣。它將會是索引2而不是3。 – Guy

相關問題