i am tying to use findelements to get all the text into one object and then see if a string is present in the list or not
Browser_Launch("chrome"); sign_in(); String a = null; Element_to_be_clicked("xpath", "//*[@id='history-guide-item']/a"); List<WebElement> text = driver.findElements(By.xpath("//ol[@class='item-section']//li//div//a")); for (int i = 0; i < text.size(); i++) { a = text.get(i).toString(); System.out.println(a); } if (a.contains("Will & Grace - Back This Fall")) { System.out.println("test passed"); } else { System.out.println("test failed"); } Website: Youtube page: history
test: trying to get all the name of the videos present in history page to a object so that i can assert
Thank you