Quality is delighting customers
Learning Basic Level selenium - webdriver
How to open sub menu by using mouse hover.
Tags:
The general flow would be something like:
WebElement menuHoverLink = driver.findElement(By.linkText("menu link text"));
Actions actions = new Actions(driver);
actions.moveToElement(menuHoverLink).perform();
WebDriverWait wait = new WebDriverWait(driver,10);wait.until(ExpectedConditions.presenceOfElementLocated(By.linkText("sub menu text")));
driver.findElement(By.linkText("sub menu text")).click();
Thanks for sharing your knowledge....
How to select the previous month / next month date by using selenium web driver.... i uploaded calender image, which is i am used...please share your script...
As per software testing services company, it's not a good approach to select backdate in the calendar. Most of the application calendar backdate are disabled. But if you need to perform backdate scenario this selenium having minusDays method so you can use these.
So here the code:
For future dates:
public Date incrementDateByDays(int incrementDays) {
LocalDate newDate = LocalDate.now().plusDays(incrementDays);
return Date.from(newDate.atStartOfDay(ZoneId.systemDefault()).toInstant());
}
In Case when you want to choose to backdate replace plusDays with minusDays
e.g.:- LocalDate newDate = LocalDate.now().minusDays(daysToSubtract)
From the above code, you have the future and backdate you have to match this with your current date(Calendar) and iterate till it matches the calendar date.
If need more details please share the web address(or similar calendar on another web if you have) where you want to perform this action.
© 2021 Created by Quality Testing.
Powered by