Selenium Webdriver/IE/Python - raise WebDriverException("Unable to load the IEDriver.dll component")

260 views
Skip to first unread message

ron4563

unread,
Oct 31, 2011, 12:05:29 PM10/31/11
to Selenium Users
Hi Everyone,

I wrote a few automated scripts to test my understanding of selenium
and python and was able to get them to work on Firefox. This one will
add a List Group to my Yahoo email account so that I can later assign
Contacts to this new list group.

Now I want to convert this script to work for IE8 browser on Windows.
Thought all I had to do was change from

self.driver = webdriver.Firefox()

to
self.driver = webdriver.Ie().

However, when I try to execute the script, I get the raised exception
below

E
======================================================================
ERROR: test_yahoo_create_list_ie (__main__.YahooCreateListIE)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:/Python27/PythonPrograms/SeleniumTestCases/
YahooCreateList_IE.py", line 9, in setUp
self.driver = webdriver.Ie()
File "C:\Python27\lib\site-packages\selenium\webdriver\ie
\webdriver.py", line 45, in __init__
raise WebDriverException("Unable to load the IEDriver.dll
component")
WebDriverException: Message: 'Unable to load the IEDriver.dll
component'

----------------------------------------------------------------------
Ran 1 test in 0.016s

FAILED (errors=1)

Traceback (most recent call last):
File "C:/Python27/PythonPrograms/SeleniumTestCases/
YahooCreateList_IE.py", line 49, in <module>
unittest.main()
File "C:\Python27\lib\unittest\main.py", line 95, in __init__
self.runTests()
File "C:\Python27\lib\unittest\main.py", line 231, in runTests
sys.exit(not self.result.wasSuccessful())
SystemExit: True

*************************************************************************************

See actual script below:

Can anyone tell me how to correct this problem? And are they any
special quirks that I need to worry about when you run on IE browser?

Thanks for any help or suggestions.

Appreciate it.

Ron

*************************************************************************************

from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.support.ui import WebDriverWait
import unittest, time, re

class YahooCreateListIE(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Ie()
self.driver.implicitly_wait(30)
self.base_url = "http://www.yahoo.com/"
self.verificationErrors = []

def test_yahoo_create_list_ie(self):
driver = self.driver
driver.get(self.base_url)
driver.find_element_by_xpath("//*[@id='default-p_29445946-bd']/
ul/li[1]/a").click()
driver.find_element_by_id("username").clear()

driver.find_element_by_id("username").send_keys("x...@yahoo.com")
driver.find_element_by_id("passwd").clear()
driver.find_element_by_id("passwd").send_keys("ppp")
driver.find_element_by_id(".save").click()
# Click on Mail link
driver.find_element_by_xpath("//*[@id='pa-u_14782488-bd']/a/
span[2]").click()
# Click on the Contacts tab
driver.find_element_by_xpath("//a[@id='tabcontacts']/
b").click()
time.sleep(5)
# Need to switch to iframe which contains search fi(eld
driver.switch_to_frame("abIframeTab")

driver.find_element_by_xpath("//a[@title='New List']").click()
# click New List button
driver.find_element_by_xpath("//input[@id='new-list-
name']").clear()
driver.find_element_by_xpath("//input[@id='new-list-
name']").send_keys("NewTestGroup")

# Save new assignment
driver.find_element_by_xpath("//span[@id='okayModalOverlay']/
a").click()
time.sleep(5)

def is_element_present(self, how, what):
try: self.driver.find_element(by=how, value=what)
except NoSuchElementException, e: return False
return True

def tearDown(self):
self.driver.quit()
self.assertEqual([], self.verificationErrors)

if __name__ == "__main__":
unittest.main()

Luke Inman-Semerau

unread,
Oct 31, 2011, 12:22:02 PM10/31/11
to seleniu...@googlegroups.com
Can you check to see if C:\Python27\Lib\site-packages\selenium\webdriver\ie   has either and x64 or win32  folder with "IEDriver.dll" file in it?


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.


ron4563

unread,
Oct 31, 2011, 1:34:57 PM10/31/11
to Selenium Users
Luke,

Under C:\Python27\Lib\site-packages\selenium\webdriver\ie, I only see
Init and webdriver python files - no x64 or win32 folders exists. How
do these get created?

Ron

On Oct 31, 12:22 pm, Luke Inman-Semerau <luke.seme...@gmail.com>
wrote:
> Can you check to see if C:\Python27\Lib\site-packages\selenium\webdriver\ie
>   has either and x64 or win32  folder with "IEDriver.dll" file in it?
>

ron4563

unread,
Oct 31, 2011, 1:42:26 PM10/31/11
to Selenium Users
Luke,

I did some searching under the C drive and found x64 and win32 folders
that exist under C:\Python27\selenium\webdriver/ie which contain dll.
Should I just move these ie under site-packages? I will try this and
see what happens.

Ron

On Oct 31, 1:34 pm, ron4563 <ronarti...@gmail.com> wrote:
> Luke,
>
> Under C:\Python27\Lib\site-packages\selenium\webdriver\ie, I only see
> Init and webdriver python files -  no x64 or win32 folders exists. How
> do these get created?webdriver\ie
>
> Ron
>
> On Oct 31, 12:22 pm, Luke Inman-Semerau <luke.seme...@gmail.com>
> wrote:
>
> > Can you check to see if C:\Python27\Lib\site-packages\selenium\webdriver\ie
> >   has either and x64 or win32  folder with "IEDriver.dll" file in it?
>
> > On Mon, Oct 31, 2011 at 9:05 AM, ron4563 <ronarti...@gmail.com> wrote:
> > > Hi Everyone,
>
> > > I wrote a few automated scripts to test my understanding of selenium
> > > and python and was able to get them to work on Firefox. This one will
> > > add a List Group to my Yahoo email account so that I can later assign
> > > Contacts to this new list group.
>
> > > Now I want to convert this script to work for IE8 browser on Windows.
> > > Thought all I had to do was change from
>
> > > self.driver= webdriver.Firefox()
>
> > > to
> > > self.driver= webdriver.Ie().
>
> > > However, when I try to execute the script, I get the raised exception
> > > below
>
> > > E
> > > ======================================================================
> > > ERROR: test_yahoo_create_list_ie (__main__.YahooCreateListIE)
> > > ----------------------------------------------------------------------
> > > Traceback (most recent call last):
> > >  File "C:/Python27/PythonPrograms/SeleniumTestCases/
> > > YahooCreateList_IE.py", line 9, in setUp
> > >    self.driver= webdriver.Ie()
> > >  File "C:\Python27\lib\site-packages\selenium\webdriver\ie
> > > \webdriver.py", line 45, in __init__
> > >    raise WebDriverException("Unabletoloadthe IEDriver.dll
> > > component")
> > > WebDriverException: Message: 'Unabletoloadthe IEDriver.dll
> > >        self.driver= webdriver.Ie()
> > >        self.driver.implicitly_wait(30)
> > >        self.base_url = "http://www.yahoo.com/"
> > >        self.verificationErrors = []
>
> > >    def test_yahoo_create_list_ie(self):
> > >        driver= self.driver

ron4563

unread,
Oct 31, 2011, 2:39:14 PM10/31/11
to Selenium Users
Luke,

I copied those dll folders and contents and it now brings up the IE
browser. Something must have gotten screwed up when I loaded selenium.
Thanks for your help.

I need to research why it is not locating the user name field to login
but this is at least a start for now.

Thanks again,

Ron
Reply all
Reply to author
Forward
0 new messages