B
B
Bergis2019-09-04 18:26:01
Python
Bergis, 2019-09-04 18:26:01

How to solve the problem in selenium?

Got the code:

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

class PythonOrgSearch(unittest.TestCase):

    def setUp(self):
        self.driver = webdriver.Firefox()

    def test_search_in_python_org(self):
        driver = self.driver
        driver.get("http://www.python.org")
        self.assertIn("Python", driver.title)
        elem = driver.find_element_by_name("q")
        elem.send_keys("pycon")
        elem.send_keys(Keys.RETURN)
        assert "No results found." not in driver.page_source


    def tearDown(self):
        self.driver.close()

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

after launch, the browser opens and an error pops up in the console.
ERROR: test_search_in_python_org (__main__.PythonOrgSearch)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\User\Desktop\проекты\Разработка\питон\selenium\знакомство.py", line 12, in test_search_in_python_org
    driver.get("http://www.python.org/")
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 333, in get
    self.execute(Command.GET, {'url': url})
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Reached error page: about:neterror?e=proxyConnectFailure&u=https%3A//yandex.ru/&c=UTF-8&f=regular&d=Firefox%20is%20configured%20to%20use%20a%20proxy%20server%20that%20is%20refusing%20connections.


----------------------------------------------------------------------
Ran 1 test in 4.149s

FAILED (errors=1)

how can this problem be solved?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2019-09-04
@dimonchik2013

Well, what's the problem, you know?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question