我在网页中有一个表格,因为我有一个如图所示的界面。通过匹配接口名称我需要点击箭头

http://img4.mukewang.com/643769b100011f8217470942.jpg

我有一个网页,我有一个表格,通过匹配到我需要点击箭头的接口代码。

driver.findElement(By.xpath("//td/descendant::span[contains(text(),'STR_PGW.RETURN')]/parent::tr/td/descendant::button[@class='kbnDocTableOpen__button']")).click();



一只萌萌小番薯
浏览 81回答 1
1回答

UYOU

public void payload(WebDriver driver, BaseTest basetest) throws Exception {&nbsp; &nbsp; List<WebElement> PayloadXml = driver.findElements(By.xpath("//tr[@ng-repeat='field in fields']"));&nbsp; &nbsp; System.out.println("payload");&nbsp; &nbsp; for (WebElement P : PayloadXml)&nbsp; &nbsp; &nbsp; &nbsp; System.out.println(P.getText());&nbsp; &nbsp; List<WebElement> PayloadXmlvalues = driver.findElements(By.xpath("//div[@class='kbnDocViewer__value']"));&nbsp; &nbsp; String payload = "<CreditReturnRequest>";&nbsp; &nbsp; for (WebElement V : PayloadXmlvalues)&nbsp; &nbsp; &nbsp; &nbsp; System.out.println(V.getText());&nbsp; &nbsp; for (int i = 0; i <= PayloadXmlvalues.size(); i++) {&nbsp; &nbsp; &nbsp; &nbsp; // System.out.println("Content text is : " + PayloadXml.get(i).getText());&nbsp; &nbsp; &nbsp; &nbsp; // match the content here in the if loop&nbsp; &nbsp; &nbsp; &nbsp; if (PayloadXml.get(i).getText().contains(payload)) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; String xmlvalues = PayloadXmlvalues.get(i).getText();&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; String xmlOutputFile = "data.xml";
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java