Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/
/** * Function to explicitly wait for an element to become visible for a * designated duration * * @param driver * -WebDriver currently in use by script * @param by * -By identifying the element to be interacted with * @param duration * -Int identifying the wait time in seconds */ protected static void waitForVisible(WebDriver driver, By by, int duration, String selector) { for (int x = 0; x <= 5; x++) { try { new WebDriverWait(driver, duration).until(ExpectedConditions.visibilityOfElementLocated(by)); break; } catch (StaleElementReferenceException e) { e.printStackTrace(); } } }
This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!
1.4k questions
1.6k answers
866 comments
1.9k users