Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

selenium web driver giving error 'Fire fox has stopped working' while opening firefox window #439

Closed
Anup-Deo21 opened this issue Jun 27, 2016 · 1 comment

Comments

@Anup-Deo21
Copy link

below is my code for Assign1.py file

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

create a new Firefox session

driver = webdriver.Firefox()
driver.implicitly_wait(30)
driver.maximize_window()

navigate to the application home page

driver.get("http://www.google.com")

get the search textbox

search_field = driver.find_element_by_id("lst-ib")
search_field.clear()

enter search keyword and submit

search_field.send_keys("Selenium WebDriver Interview questions")
search_field.submit()

get the list of elements which are displayed after the search

currently on result page using find_elements_by_class_name method

lists = driver.find_elements_by_class_name("_Rm")

get the number of elements found

print str(len(lists))

iterate through each element and print the text that is

name of the search

i = 0
for listitem in lists:
print (listitem)
i = i + 1
if (i > 10):
break

close the browser window

driver.quit()

After running the code using

Python Assign1.py

it is showing following error while opening fire fox browser

firefox_error

After clicking on close program it showing following errors on command prompt:

Traceback (most recent call last):
File "Assign1.py", line 5, in
driver = webdriver.Firefox()
File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\webdriver.py",
line 85, in init
keep_alive=True)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", l
ine 90, in init
self.start_session(desired_capabilities, browser_profile)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", l
ine 177, in start_session
response = self.execute(Command.NEW_SESSION, capabilities)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", l
ine 234, in execute
response = self.command_executor.execute(driver_command, params)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\remote_connectio
n.py", line 401, in execute
return self._request(command_info[0], url, body=data)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\remote_connectio
n.py", line 432, in _request
resp = self._conn.getresponse()
File "C:\Python27\lib\httplib.py", line 1136, in getresponse
response.begin()
File "C:\Python27\lib\httplib.py", line 453, in begin
version, status, reason = self._read_status()
File "C:\Python27\lib\httplib.py", line 409, in _read_status
line = self.fp.readline(_MAXLINE + 1)
File "C:\Python27\lib\socket.py", line 480, in readline
data = self._sock.recv(self._rbufsize)
socket.error: [Errno 10054] An existing connection was forcibly closed by the re
mote host

@cgoldberg
Copy link
Member

this is not related to locust whatsoever.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants