采用C# 我是使用Selenium进行单位测试(测试我的反应前端)。 我的html是:
<article class="company-details-container">
<div class="details-header">...</div>
<div class="details-header">...</div>
<div class="details-header">...</div>
<div class="details-header">...</div>
<div class="details-header">...</div>
</article>
I would like to click the first element inside the last div... I am able to click the first element inside the first div by...
IWebElement elementa = driver.FindElement(By.CssSelector(".details-header"));
IJavaScriptExecutor executor1 = (IJavaScriptExecutor)driver;
executor1.ExecuteScript("arguments[0].click()", elementa);
我已经尝试了<条码>IWebElement 要素a = 司机.FindElement(By.CssSelector(......details-header[0]”);,但这并非奏效。
AN?