There is such a piece of code:

button = self.driver.find_element_by_id('........').click() button.click() 

And this:

 self.driver.find_element_by_id('......').click() 

Both workers. Which is more correct ... true.

  • In this line: button = self.driver.find_element_by_id('........').click() in the button written, what the click() method returns. If it does not return anything, then None written to the button , and on the next line you will have an error that NoneType does not have a click() method. - insolor
  • one
    In fact, both options are not correct. You do not handle the possibility that the element will not be visible on the page and clicking on an invisible element will throw out an error - danilshik 1:59 pm
  • @insolor And what does the click() method return is the click() method? - Enikeyschik
  • @ Enikeyschik if I worked with selenium, I would answer for sure. But most likely not. - insolor
  • @insolor And so it seems to me too. - Enikeyschik

0