lundi 1 février 2021

How to take the values from the variable and enter in the text box?

titles – is a string variable that contains the string values

List<String> titles = new WebDriverWait(driver, 20).until(ExpectedConditions.visibilityOfAllElementsLocatedBy(By.xpath("//div[@class='document-card__details']//h3/a"))).stream().map(element->element.getAttribute("innerHTML")).collect(Collectors.toList());
System.out.print("THE NAME ARE " + titles);

below is the x-path of a search box

driver.findElement(By.xpath("//div[@class='text-filter__input']//input[@placeholder='Search Title']"));

The action I want to perform – To take the random values from the titles[variable] and enter that in the search box.

Is there any way to do it?




Aucun commentaire:

Enregistrer un commentaire