我正在使用一些自动化测试,并且正在使用Selenium Web驱动程序。到目前为止,我已经编写了一个脚本,该脚本可以找到该类,但是无法在下拉列表中选择其中一项。
这是我到目前为止的脚本:
driver.FindElement(By.Id("loginOK")).Click();
Thread.Sleep(3000);
driver.FindElement(By.XPath("//*[@id = \"content\"]/div[3]/div[2]/div[1]/a[1]")).Click();
Thread.Sleep(3000);
driver.FindElement(By.XPath("//*[@id= \"sec1272\"]/table/tbody/tr[2]/td[2]/div/img")).Click();
Thread.Sleep(3000);
driver.FindElement(By.ClassName("fm - s fm - off fm - focused"));
,我要选择以下一项:
<tbody>
<tr class="row" oid="12" height="24"><td class="ln">Bujqesi, Zhvillim rural, Pyjet dhe kullotat, Natyra dhe Biodiversiteti</td></tr>
<tr class="row-selected" oid="13" height="24"><td class="ln">Burime Njerezore</td></tr>
<tr class="row" oid="9" height="24"><td class="ln">Administrimi dhe menaxhimi i institucioneve te arsimit parauniversitar</td></tr>
<tr class="row" oid="14" height="24"><td class="ln">Ceshtje ligjore/Asete</td></tr>
<tr class="row" oid="15" height="24"><td class="ln">Emergjencat Civile/Mbrojtja nga Zjarri</td></tr>
<tr class="row" oid="10" height="24"><td class="ln">Hapesire Publike/Mjedis</td></tr>
<tr class="row" oid="2" height="24"><td class="ln">Kerkesa/Ankesa te pergjithshme</td></tr>
</tbody>
非常感谢:)