WebDriverException when Background

We have a recurring error testing android. When i do “self.driver.background_app(3)” sometimes happends a WebDriverException.

We have to do background to update de xml tree of uiAutomator. If we dont do that, cant wait any element there because never appear.

My question are two:

  • can we do another thing to refresh the xml tree?
  • what can we do to avoid WebDriverExceptions? good practices or something like that…

Help me pleease! :smiley: