实际例子:
实例一:
不得不说下第一个例子,谢谢selenium论坛的大神门,XPATH还有这种方式的定位,传说是“治疗一切跌打损伤,及text找不到”(Antony群友帮解决的,在此谢谢)
---------------------------------------------------------------------------------------------------------------------------
实例二:
(By.xpath("//span[text()='bbb']"));
--------------------------------------------------------------------------------------------------------------------------
实例三:
(By.xpath("//a[@title='删除']"))
--------------------------------------------------------------------------------------------------------------------------
实例四:
(By.xpath("//div[contains(text(),'确定')]"))
--------------------------------------------------------------------------------------------------------------------------
实例五:
driver.switchTo().frame(driver.findElement(By.xpath("//iframe[contains(@src,'http://passport.fumubang.com')]")));
---------------------------------------------------------------------------------------------------------------------------
实例六: