Might be due to the design which passes the incorrect driver object to the page object.
Or another way that applies more OOP and design patterns.
WebDriverWait ExpectedConditions.visibilityOfElementLocated
For example, when sending the key to the file upload input
tag.
Set<String> s = driver.getWindowHandles();
Return current page or another page.
For example,
When cannot locate the checkbox
element in the table row/ column, can try to click on the tb
element which contains the target string.
When fail to locate an element with a certain attribute (eg, class), try to locate by using different locating methods (eg, use By.cssSelector
or By.className
or By.xPath
)
For example, locate button element:
This doe not work
But this works
Increase the waiting time for the element to exist or be displayed.
If does not work, can try scrolling to the element which is located at the page end instead.
If cannot scroll to certain elements, try to scroll to other elements on the same page, and return that element. And use XPath Axes to locate the target element.
Most common way:
Another way that might work, refer to: https://medium.com/geekculture/best-way-to-use-scrollintoview-in-selenium-using-javascriptexecutor-f53518c5beed
Select an item in a multi-select element.
Solution: https://www.guru99.com/select-option-dropdown-selenium-webdriver.html
Click on the parent element of it, and maybe add Thread.sleep
to force sleep.
For example:
Solution:
Wait visible and with delay in between to make sure it stay.
unselectable="on"
For example, solution: https://stackoverflow.com/questions/38751384/clicking-on-a-field-name-whose-unselectable-is-on-using-selenium
*
* Wait a while and remove the attribute of the element
Refer to: https://www.lambdatest.com/blog/how-to-handle-web-table-in-selenium-webdriver/
* Get text in each td
Run testNG parallel.
Remove the extra driver variable in the Page class (Because the driver is already in the PageBase class, no need to have it in the Page class that extends PageBase class)
For example,
SetupVersionPage
that extends PageBase
PageBase
selenium
java
test automation
software test