Super explanation of Stale element exception and how to handle
QA & Testing: StaleElementException
Bugs are happily living there and they always will, unless Computers begin to develop IQ
Wednesday, June 29, 2016
Wednesday, June 22, 2016
[TIPS] Wait for Page Load in Selenium Webdriver
Selenium WebDriver supports implicit wait (applies on findElement and findElements) and explicit wait (works with some explicit condition specified by automation tester on page element. Check Selenium 2 library for more details).
Using selenium WebDriver with Java script we can wait for Page load condition.
I created below method under my UIAction class which I re-used.
public boolean waitForPageLoad(long seconds) {
try {
new WebDriverWait(driver, seconds).until(new ExpectedCondition<Boolean>() {
@Override
public Boolean apply(WebDriver wdriver) {
return ((JavascriptExecutor) driver).executeScript("return document.readystate").equals("complete");
}
});
return true;
} catch (Exception e) {
System.out.println("Method waitForPageLoad: Exception " + e.getMessage());
return false;
}
}
Now above code executed JavaScript code "document.readystate" which return following 5 string values:
uninitialized - page loading not yet started
loading - page loding inprogress
loaded - page loaded
interactive - user can intereact with fields
complete - page fully loaded
Using selenium WebDriver with Java script we can wait for Page load condition.
I created below method under my UIAction class which I re-used.
public boolean waitForPageLoad(long seconds) {
try {
new WebDriverWait(driver, seconds).until(new ExpectedCondition<Boolean>() {
@Override
public Boolean apply(WebDriver wdriver) {
return ((JavascriptExecutor) driver).executeScript("return document.readystate").equals("complete");
}
});
return true;
} catch (Exception e) {
System.out.println("Method waitForPageLoad: Exception " + e.getMessage());
return false;
}
}
Now above code executed JavaScript code "document.readystate" which return following 5 string values:
uninitialized - page loading not yet started
loading - page loding inprogress
loaded - page loaded
interactive - user can intereact with fields
complete - page fully loaded
BitBucket: Facing issue with SSH key for repo
Below is the error message displayed while push in origin master
conq: repository access denied. deployment key is not associated with the reques
ted repository.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
One of the best solution provide here
conq: repository access denied. deployment key is not associated with the reques
ted repository.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
One of the best solution provide here
Subscribe to:
Posts (Atom)
Read CSV from S3
import csv def count_records(csv_file): record_count = 0 first_line = None last_line = None # Open the CSV file and read it...
-
Super explanation of Stale element exception and how to handle QA & Testing: StaleElementException
-
Check out Level 1 - Foundation Training MCQs Provide you feedback under comment section - 1. Machine Templates only work for: Activ...
-
Here are the collection of UiPath MCQ question helpful in certification in UiPath RPA and interview. Check out Level 2 - Orchestrato...