2015-06-12 43 views

回答

0

選擇「更新」可以像這樣通過的XPath

實現
"//span[@class='ui-button-text']/text()" 

不過我覺得你的意思是你如何能得到這個文本元素,這更像是通過css選擇器(假設'driver'是一個正確啓動的WebDriver):

driver.findElement(By.cssSelector("span.ui-button-text")).getText() 

或與xapth:

driver.findElement(By.xpath("//span[@class='ui-button-text']")).getText() 
0

您可以嘗試

//span[text()='Update'] 
相關問題