1

I am trying to click on the ARCGIS button on webpage https://gisapr.atco.com/portal/home/signin.html?returnUrl=https%3A%2F%2Fgisapr.atco.com%2Fportal%2Fhome%2F

But getting no element found or timeout errors.

I'm also unable to access inside login form contents but no luck.

Tried:

  • Implicit and explicit waits
  • Time sleep()
  • by all finds..
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
MOHD ALTAF
  • 33
  • 4
  • Help us to help you - Please improve your question, so that we can reproduce your issue. How to create [mcve] Thanks -- Some code would be cool – HedgeHog Feb 08 '21 at 20:52

1 Answers1

0

The element ARCGIS is within an <iframe> so you have to:

  • Induce WebDriverWait for the desired frame to be available and switch to it.

  • Induce WebDriverWait for the desired element to be clickable.

  • You can use either of the following Locator Strategies:

    • Using CSS_SELECTOR:

      driver.get('https://gisapr.atco.com/portal/home/signin.html?returnUrl=https%3A%2F%2Fgisapr.atco.com%2Fportal%2Fhome%2F')
      WebDriverWait(driver, 20).until(EC.frame_to_be_available_and_switch_to_it((By.CSS_SELECTOR,"iframe#oAuthFrame")))
      WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "a.btn.btn_wide#ago_Name"))).click()
      
    • Using XPATH:

      driver.get('https://gisapr.atco.com/portal/home/signin.html?returnUrl=https%3A%2F%2Fgisapr.atco.com%2Fportal%2Fhome%2F')
      WebDriverWait(driver, 20).until(EC.frame_to_be_available_and_switch_to_it((By.XPATH,"//iframe[@id='oAuthFrame']")))
      WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//a[@id='ago_Name' and text()='ArcGIS']"))).click()
      
  • Note : You have to add the following imports :

     from selenium.webdriver.support.ui import WebDriverWait
     from selenium.webdriver.common.by import By
     from selenium.webdriver.support import expected_conditions as EC
    

  • Browser Snapshot:

arcgis


Reference

You can find a couple of relevant discussions in:

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • I have one doubt, how to find the iframe id or name , like in our case you found id=oAuthFrame. – MOHD ALTAF Feb 10 '21 at 07:42
  • @MOHDALTAF Open Google Chrome Dev Tool, locate the element through the inspector and traverse up the DOM and check if the element resides within ` – undetected Selenium Feb 10 '21 at 08:24