4

I found a headless IE from this github project headless-selenium-for-win

Which has the following files

desktop_utils.exe
headless_ie_selenium.exe

I extracted these files to C:\Selenium\headless-selenium

I used Selenium Python library to control IE(GUI) using IEDriverServer.exe which works well but when I use headless_ie_selenium.exe my script just went into endless execution and prints nothing.

Here is my Python Code

from selenium import webdriver
from selenium.webdriver.common.keys import Keys


#driver = webdriver.Ie(r"C:/Selenium/IEDriverServer.exe")
driver = webdriver.Ie(r"C:/Selenium/headless-selenium/headless_ie_selenium.exe")
driver.get("www.google.com")
googleSearch = driver.find_element_by_name("q")
googleSearch.send_keys("Selenium")
googleSearch.send_keys(Keys.ENTER)

import time
time.sleep(4)

print driver.title
5
  • I found using phantomjs with selenium very effective. Commented Jan 2, 2015 at 21:18
  • @PadraicCunningham I'm have to use IE for testing a site which was developed using ActiveX object. Commented Jan 2, 2015 at 21:23
  • What do you mean when you say endless execution? You don't tear down the driver instance in the script you posted, so one shouldn't expect the window to close. Commented Jan 2, 2015 at 21:34
  • @duhaime I mean, I waited for a long time but the interpreter didn't execute print driver.title statement Commented Jan 2, 2015 at 21:42
  • FWIW, due to the way the IEDriver actually works and how it interacts with IE (it is vastly different to the other drivers), fudging it to work "headless" is not supported! Commented Jan 4, 2015 at 22:48

2 Answers 2

2

I added the path of IEDriverServer.exe to System Variable path and after restarting my system the everything works fine.

Sign up to request clarification or add additional context in comments.

1 Comment

I put all three files in the same folder as my main executable. [ IEDriverServer.exe, desktop_utils.exe, headless_ie_selenium.exe ]. Easy packaging & distribution.
-1

May be problem in slashes...

Your path: C:/Selenium/headless-selenium/headless_ie_selenium.exe

Try this: C:\Selenium\headless-selenium\headless_ie_selenium.exe

and another:

Your: driver.get("www.google.com")

Try this: driver.get("https://www.google.com")

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.