python + Selenium automation environment Frequently Asked Questions summary
(1) There are three ways to operate the Windows window, one is to use the AutoIT software to generate exe programs, and then use the system command calls; SendKeys class simulates the keyboard operation (only the current focus is fixed); Pywinauto Components ( Win32gui )
(2) Pywinauto package only supports to python2.6 version. the SendKeys package cannot be successfully installed on the python3.0 version.
(3) when executing the assertion checksum of the use case, the Text property of the element is generally obtained , sometimes the text value of the element is viewed on the page , and the obtained is empty. At this point, you need to refresh the page first, and then get the text property, you can generally get success.
(4) some intermediate commands in the execution of the operation will fail, if not the command error, you can consider adding the appropriate waiting time between the commands, it can be done smoothly, such as the input box, pop-up Windows window after calling exe programs and so on.
(5)type isInputDrop- down selection box, if the element'stextattribute location, the report "elementnotvisibleexeception"Exception (the report exception is because the location path is written directlytextproperty, which should be from the nearest unique elementIDTo start, you can click on success. andSelecttype of drop-down box is not successful by two clicks, only withSelectorScc_selectormode). Change it.IDorXPATHPositioning method to locate (inputType drop-down box is not availableSelectorCss_selectorthe way to choose, you can only click the input box, and so on pop-up drop-down options, then click the dropdown option, butJava+seleniumYou can click on the input box first, then usetextthe properties of the location click the drop-down option)
Python + Selenium automation environment Frequently asked Questions summary