xml文件,我想用硒如何讀取硒司機
<?xml version="1.0" encoding="utf-8"?>
<client name="eLife"> <site>qa.elife.dev.cms30.kriyadocs.com/welcome</site>;
<xpath>
<publication> </publication>
<Article>in progress</Article>
<Striking>Image></Striking>
<Upload>Digest</Upload> <Upload>sub article</Upload>
<Detailed></Detailed>
</xpath>
</client>
代碼片段閱讀這個XML:
System.setProperty("webdriver.chrome.driver", "/home/administrator/Downloads/chromedriver");
WebDriver driver = new ChromeDriver();
String URL = "http://localhost/config.xml";
String course = driver.findElement(((WebElement) By.xpath(".//*[@id='pass-nodes-list']/li/div[2]/a")).getText());
您的問題尚不清楚。在瀏覽器中加載xml文件後,是否想通過java代碼或selenium讀取任何xml文件? –
是的我想在Java代碼中讀取XML文件通過硒 – muthubala
發佈xml文件以供參考。 –