Here you need to print two list results in a specific format, combining the two data lists. For example: as shown in the image
Normal (5-7 days): rupees. 2,400.00
Fast (3-5 days): Rs. 3,000.00
Express (2-3 days): Rs. 3,600.00
Here is my code
List<WebElement> ShippingLabel = driver.findElements(By.xpath(" //label[contains(@class,'radio__label')]"));
List<WebElement> ShippingPrice = driver.findElements(By.xpath(" //label[contains(@class,'radio__label')]/following-sibling::span"));
for (WebElement SLelement: ShippingLabel) {
System.out.println("Testingl:"+SLelement.getText());
}
for (WebElement SPelement1: ShippingPrice) {
System.out.println("Testinglp:"+SPelement1.getText());
}
source
share