New answers tagged

0

I would also suggest to make it less messy: Make few generic db connection/retrieval functions if data retrieval is not dynamic , create separate script to populate a data source like an file: json, csv or excel to further use directly in simpler way in tests.


0

To select the element with text as Constants.INBOUNDORDER_CUSTOMER as the element is a Angular element you need to induce WebDriverWait for the elementToBeClickable() and you can use the following Locator Strategies: List<WebElement> options = select.findElements(By.xpath("//div[@class= 'mat-autocomplete-panel ng-star-inserted mat-autocomplete-...


1

driver.findElement(By.name("pincode")).sendKeys(rs.getString(1)); Is this what you looking for


1

Mobile and windows screen will have different size , I checked the page and it seems the height is larger in mobile screen try using jaa.executeScript("document.body.scrollBy(0,350);", "");


1

To gather the items for your list it looks like you don't need to be specific. Try something like this: List<WebElement> options = driver.findElements(By.xpath(//*[contains(@id,"mat-option-")])); That will populate your options List with all the elements that have an ID that contains mat-option-


0

Please try to this one package com.tests; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.testng.Assert; import org.testng.annotations.Test; public class IfExampleSelenium { @Testpublic void testPageTitle() { System.out.println("Launching Firefox browser.."); WebDriver driver = new FirefoxDriver(); ...


0

If you want to go with the class name, and have the space in it, you can simply leave the part of the class name before or after the space and delete the rest, e.g.: findElement(By.className("js-general-error general-error cbt d-none")); will give you error, instead you just go with the part of class name not containing space findElement(By....


1

You are using java jdk 8 , You should update it to jdk 11+ https://stackoverflow.com/q/9170832/6793637


Top 50 recent answers are included