Reputation: 111
I'm trying to test a system that only works in Internet Explorer 8, using Selenium Webdriver.
I've downloaded the last version of IE webdriver and an old version but any of them are not working. I set the security configurations on 'Internet Options' just like some answers that I already read here and the System Variables.
I tested using some simple urls like www.google.com to know if there's something wrong with my system but the same errors occur.
I'm writing the scripts in Python and there's a example below:
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import NoAlertPresentException
from selenium.webdriver.common.action_chains import ActionChains
import unittest, time, re
class testAccess(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Ie("C:\\PythonXX\\Drivers\\IEDriverServer.exe")
self.driver.implicitly_wait(30)
self.driver.maximize_window()
# URL
self.base_url = "http://www.google.com"
self.verificationErrors = []
self.accept_next_alert = True
def test_Logon(self):
driver = self.driver
driver.get(self.base_url + "/")
time.sleep(3)
driver.find_element_by_id("username").send_keys("username")
driver.find_element_by_id("password").send_keys("password")
driver.find_element_by_id("logIn").click()
time.sleep(5)
def is_element_present(self, how, what):
try: self.driver.find_element(by=how, value=what)
except NoSuchElementException as e: return False
return True
def is_alert_present(self):
try: self.driver.switch_to_alert()
except NoAlertPresentException as e: return False
return True
def close_alert_and_get_its_text(self):
try:
alert = self.driver.switch_to_alert()
alert_text = alert.text
if self.accept_next_alert:
alert.accept()
else:
alert.dismiss()
return alert_text
finally: self.accept_next_alert = True
def tearDown(self):
self.driver.quit()
self.assertEqual([], self.verificationErrors)
if __name__ == "__main__":
unittest.main()
When I execute this script IE opens and return the message "This is the initial start page for the WebDriver server.". The console that opens when the script are executed crashes and return with the error: "Command line server for ie driver has stopped working".
On Selenium Documentation sounds clear the use of webdrivers but don't explain the uses in old Internet Explorer versions. I don't know how exactly I'm doing wrong and I already read a lot of answers that didn't help yet.
Upvotes: 0
Views: 1661
Reputation: 111
Oh right! I solve that downloading the first version of IEDriverServer (2.39) available on http://selenium-release.storage.googleapis.com/index.html.
Except for that, I did the Required Configuration described on https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver
It's working now! haha :)
Upvotes: 2