在点击网页内的选项卡时,代码无效,甚至在执行代码时也没有出现任何错误。 我写的代码单击选项卡[ 分类 ]
FileLoadException: Could not load file or assembly 'System.Core,
Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of
its dependencies. The located assembly's manifest definition does not match
the assembly reference. (Exception from HRESULT: 0x80131040)
at ZXing.BarcodeReader..ctor()
at HelloWorldV2.Start()

WebElement tabCategory = driver.findElement(By.xpath("//dd[2]//a[@class='btn f1']"));
tabCategory.click()

答案 0 :(得分:0)
请尝试以下任何一项xpath
。
//a[text()= 'Categorization']/following::a
OR
//span[@class='TabRight']/..//preceding-sibling::a[text()= 'Categorization']/following::a