python + selenium face questions

A, selenium elements in how to determine whether there is
  
expected_conditions module provides a variety of parity, my favorite one is presence_of_element_located (to determine whether an element is added to the dom tree,
does not mean that certain elements visible, if targeted to returns WebElement)

Two, selenium in hidden or display = none of the elements if you can locate?
  Can locate, but can not operate, in order to show the more we will be, we can say that to judge by is_displayed () method to display or not display, if you want to click on, you can use js
remove dispalay = none attribute.

Third, how to ensure the success of the operation in selenium elements? That is how to ensure that I click on certain elements are clickable?
  Or until until_not method provided by the wait module WebDriverWait expected_conditions classes and used in combination for the second package.

Fourth, how to improve execution speed selenium script?
  1. less sleep, do not try to implicitly_wait
  explicit wait method 2. Multi

Fifth, use cases often unstable situation during operation, that is to say by this time, next time there is no way through, and how to improve the stability of the use cases?
  Or until until_not method provided by the wait module WebDriverWait expected_conditions classes and used in combination for the second package.

Sixth, when automated testing is not required to connect to the database for data verification?
  UI Automation is not required, the interface will need to test

Seven, id, name, class, xpath , css selector of these properties, most of which you prefer, and why?
  I like to use css selector css syntax is simple, fast positioning (xpath syntax long, slow positioning, not stable)

Eight, how to locate elements on the page dynamically loaded?
  To judge until loop provided by the wait module class WebDriverWait whether a use of the element

Nine, how to locate an element attribute dynamic?
  First to find the elements of the same attributes, if changed, then find the same parent element, level with positioning

Ten, how to select a value in the drop-down box = xx option?
  1, twice a click can be done by
  2, by executing the js script to do (provided that you can write js code)
  3, the Selenium provides select module, we can select the module by positioning methods, such as index_of, value, text
  4, can also xpath location, but sometimes an error

XI What is the biggest flaw UI Automation is?
  
When demand changes in large, large maintenance costs

Twelve, webdriver interface test can be used to do it?
  
Not, webdriver is designed to do webUI automated.

Guess you like

Origin www.cnblogs.com/yttbk/p/10993844.html
Recommended