title: Written test does not work the same every time using Selenium and Python
body: <p>I have link on web page and after click it system dialog window is open. Everything work fine when code is in one file (simple script). When I use Page Object Model and run test it is works strange. I mean sometimes element is clickable and system dialog window appears and sometimes no but test is not failed, it pass.</p>
  <p>element from html:</p>
  <pre><code>&lt;label class=&quot;file-drop_file__input__3yejR&quot;&gt;&lt;input accept=&quot;image/*&quot; type=&quot;file&quot; autocomplete=&quot;off&quot; tabindex=&quot;-1&quot; style=&quot;display: none;&quot;&gt;Upload from desktop&lt;/label&gt;
  </code></pre>
  <p>BasePage.py</p>
  <pre><code>class BasePage:
  
  def __init__(self, driver):
      self.driver = driver
  
  def click_element(self, by_locator):
      try:
          element = WebDriverWait(self.driver, 10).until(EC.visibility_of_element_located(by_locator))
          self.driver.execute_script(&quot;arguments[0].click();&quot;, element)
      except EX as e:
          print(&quot;Exception! Can't click on the element&quot;)
  </code></pre>
  <p>Page.py</p>
  <pre><code>class SmartConsultation(BasePage):
  
  upload_from_desktop_link = (By.XPATH, &quot;//label[@class='file-drop_file__input__3yejR']&quot;)
  
  def __init__(self, driver):
      super().__init__(driver)
  
  def click_upload_from_desktop_link(self):
      self.click_element(self.upload_from_desktop_link)
  </code></pre>
  <p>step.py</p>
  <pre><code>@step(&quot;Click upload link&quot;)
  def click_upload_from(context):
      context.app.smart_consultation_page.click_upload_from_desktop_link()
  </code></pre>
  <p>I tried to set path to link in many ways but without any good result. Always works correctly when test is run as simple script in one file, but when use POM problem appears again</p>
  <p>Many thanks for help.</p>