-1

A simple python program freezes on the get() function of the selenium driver and does not return.

Please find below the written code:

        self.browser = webdriver.Ie("IEDriver\\IEDriverServer.exe")
        self.browser.get(<url_in_quotes>)
        print('here') ##does not print
        self.browser.find_element_by_id('txtUname').send_keys(self.username)
        self.browser.find_element_by_id('txtPword').send_keys(self.password)
        self.browser.find_element_by_id('Submit').click()

I am using python 3.11 and IEDriver.

I have tried using implicit and explicit wait but the execution of the program freezes at the get() function. Please suggest a way out.

  • 1
    Without the actual link you trying to open this question is missing minimal debugging details – Prophet Oct 31 '22 at 17:17
  • here `self.browser.get('url')` `url` is considered not as a variable name but as a string that contains word 'url', maybe it is gonna work if you get rid of quotes => you need not `get('url')`but just `get(url)` – Dmitriy Neledva Oct 31 '22 at 17:19
  • I can not share the link. I am using the appropriate URL as an argument. – QwertyQuirk Oct 31 '22 at 17:20
  • @Prophet How to extract minimal debugging details? – QwertyQuirk Oct 31 '22 at 17:23
  • At least to provide the link to the page you are working on – Prophet Oct 31 '22 at 17:26
  • @Prophet Sorry, I can not share the link. I got the following error after 300 seconds of program execution: selenium.common.exceptions.TimeoutException: Message: Timed out waiting for page to load. – QwertyQuirk Oct 31 '22 at 17:39
  • You'll need to set the security zones to the same level in the browser. See here: https://www.selenium.dev/documentation/ie_driver_server/ – pcalkins Oct 31 '22 at 18:40
  • @pcalkins Thank you for the information. The script worked fine when I disabled the protected mode in IE. – QwertyQuirk Nov 08 '22 at 12:59

1 Answers1

1

As suggested by Pcalkins, I made the necessary configuration changes in IE settings and the python code worked. Please refer to the link below for recommended settings: https://www.selenium.dev/documentation/ie_driver_server/