1. Start end time only support control selection, do not support fill, how to do?
Such as:
Solution:
Support Javascipt to remove the reaonly attribute of the start end time and then enter it, for example:
/**
* Enter start date
*
* @param startdate
*/
public void Inputstartdate (String startdate) {
String Startjs = "document.getElementById (' StartDate '). RemoveAttribute (' readonly ');";
((Javascriptexecutor) webdriver). Executescript (Startjs);
Webdriver.typebyid ("StartDate", StartDate);
}
2. Due to the addition of new requirements, resulting in page element path changes, the original good automated test case execution failed
Solution:
When positioning elements, use id,name and so on as possible to locate, as far as possible without XPath.
If you test the system many element ID or name, etc. is not unique or even not, resulting in the need to use XPath positioning, then you can negotiate with the development students. Let them later develop new code when possible to add the element ID or name these attributes, and name the unique
Selenium Webdriver Tips for use (ongoing updates)