I want to know "How and where to store dynamic (Search results) result/data", I am getting the results and not sure what to do next.
Also, after saving these results I want to use this in another class (By index I want to compare with other values or .equals).
Application url is: http://www.jabong.com/shoes/Puma/?qc=puma%20shoes&r=2
Below is the sample code, please let me know how to do it.
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Test1 {
public static WebDriver driver = new FirefoxDriver();
static String[] imageLocation = null;
public static void main(String []args) throws Exception {
driver.get("http://www.jabong.com/shoes/Puma/?qc=puma%20shoes&r=2");
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.manage().window().maximize();
List<WebElement> listOfOptions = driver.findElements(By.xpath(".//*[@id='content']/section/section/div[5]/div[2]"));
for(WebElement listOfOption :listOfOptions ){
System.out.println(listOfOption.getText());
}
}
}