1 回答
TA贡献1878条经验 获得超4个赞
public void payload(WebDriver driver, BaseTest basetest) throws Exception {
List<WebElement> PayloadXml = driver.findElements(By.xpath("//tr[@ng-repeat='field in fields']"));
System.out.println("payload");
for (WebElement P : PayloadXml)
System.out.println(P.getText());
List<WebElement> PayloadXmlvalues = driver.findElements(By.xpath("//div[@class='kbnDocViewer__value']"));
String payload = "<CreditReturnRequest>";
for (WebElement V : PayloadXmlvalues)
System.out.println(V.getText());
for (int i = 0; i <= PayloadXmlvalues.size(); i++) {
// System.out.println("Content text is : " + PayloadXml.get(i).getText());
// match the content here in the if loop
if (PayloadXml.get(i).getText().contains(payload)) {
String xmlvalues = PayloadXmlvalues.get(i).getText();
String xmlOutputFile = "data.xml";
添加回答
举报