As you can see I Have two list and I want output like one from one list and second from second list following is my code please help me in this.
Code in Selenium Webdriver in Java:
@Test
public void firstcase() {
List<WebElement> elements = dr.findElements(By.xpath("//span[@class='job-card__subtitle hidden-xs']//span"));
System.out.println("Company name:" + elements.size());
List<WebElement> Jobelements = dr.findElements(By.xpath("(//div[contains(@class,'job-card__title title-overflow')])"));
System.out.println("Profile:-" + Jobelements.size());
for (WebElement temp : elements) {
System.out.println("Company name:" +temp.getText());
}
for (WebElement tempjob : Jobelements) {
System.out.println("Profile:-" +tempjob.getText());
}
}
my output is:=
Company name:-6
Profile:-6
Company name:-Canon
Company name:-Reliance Automation
Company name:-Alibaba
Company name:-Kodak
Company name:-Vodafone
Company name:-PeopleGrove
Profile:-Market Researcher
Profile:-Program Manager
Profile:-Developer
Profile:-Market Researcher
Profile:-Sales Representative
Profile:-Customer Support Specialist