Home WeChat Applet WeChat Development Solution to error reported after upgrading selenium 3.3.0

Solution to error reported after upgrading selenium 3.3.0

Mar 18, 2017 pm 05:47 PM
selenium

Solution to the error after upgrading selenium 3.3.0

sudo pip install --upgrade selenium
In [4]: import selenium
In [5]: selenium.version
Out[5]: '3.3.0'
Copy after login

The error when executing the test is as follows:

swot@pp:~/pp/superlists$ python manage.py test functional_tests.tests.NewVisitorTest.test_layout_and_styling
Creating test database for alias 'default'...
E
======================================================================
ERROR: test_layout_and_styling (functional_tests.tests.NewVisitorTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/swot/pp/superlists/functional_tests/tests.py", line 123, in test_layout_and_styling
    inputbox.location.get('x') + inputbox.size['width']/2,
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webelement.py", line 403, in location
    new_loc = {"x": round(old_loc['x']),
TypeError: 'NoneType' object has no attribute 'getitem'
----------------------------------------------------------------------
Ran 1 test in 4.378s
FAILED (errors=1)
Destroying test database for alias 'default'...
Copy after login

The reason is: Selenium 3.3.0 requires geckodriver 0.15 due to changes in command response values

wget https://github.com/mozilla/geckodriver/releases/download/v0.15.0/geckodriver-v0.15.0-linux64.tar.gz
tar xzvf geckodriver-v0.14.0-linux64.tar.gz
sudo cp geckodriver /usr/local/bin
python manage.py test functional_tests.tests.NewVisitorTest.test_layout_and_styling
Creating test database for alias 'default'...
.
----------------------------------------------------------------------
Ran 1 test in 5.307s
OK
Destroying test database for alias 'default'...
Copy after login

Refer to the official website description:

Solution to error reported after upgrading selenium 3.3.0


The above is the detailed content of Solution to error reported after upgrading selenium 3.3.0. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Laravel development: How to use Laravel Dusk and Selenium for browser testing? Laravel development: How to use Laravel Dusk and Selenium for browser testing? Jun 14, 2023 pm 01:53 PM

Laravel development: How to use LaravelDusk and Selenium for browser testing? As web applications become more complex, we need to ensure that all parts of it function properly. Browser testing is a common testing method used to ensure the correctness and stability of an application under various browsers. In Laravel development, you can use LaravelDusk and Selenium for browser testing. This article will introduce how to use these two tools to test

Learn to install Selenium easily using PyCharm: PyCharm installation and configuration guide Learn to install Selenium easily using PyCharm: PyCharm installation and configuration guide Jan 04, 2024 pm 09:48 PM

PyCharm installation tutorial: Easily learn how to install Selenium, specific code examples are needed. As Python developers, we often need to use various third-party libraries and tools to complete project development. Among them, Selenium is a very commonly used library for automated testing and UI testing of web applications. As an integrated development environment (IDE) for Python development, PyCharm provides us with a convenient and fast way to develop Python code, so how

Using Selenium and PhantomJS in Scrapy crawler Using Selenium and PhantomJS in Scrapy crawler Jun 22, 2023 pm 06:03 PM

Using Selenium and PhantomJS in Scrapy crawlers Scrapy is an excellent web crawler framework under Python and has been widely used in data collection and processing in various fields. In the implementation of the crawler, sometimes it is necessary to simulate browser operations to obtain the content presented by certain websites. In this case, Selenium and PhantomJS are needed. Selenium simulates human operations on the browser, allowing us to automate web application testing

How to use Selenium for automated web testing How to use Selenium for automated web testing Aug 02, 2023 pm 07:43 PM

Overview of How to Use Selenium for Web Automation Testing: Web automation testing is a vital part of the modern software development process. Selenium is a powerful automated testing tool that can simulate user operations in a web browser and implement automated testing processes. This article will introduce how to use Selenium for web automation testing, and come with code examples to help readers get started quickly. Environment preparation Before starting, you need to install the Selenium library and web browser driver

Use the combination of Java, Selenium and OpenCV to solve the problem of slider verification in automated testing. Use the combination of Java, Selenium and OpenCV to solve the problem of slider verification in automated testing. May 08, 2023 pm 08:16 PM

1. Slider verification idea The slider object of the object under test looks like this. Relatively speaking, it is a relatively simple form. You need to drag the puzzle on the left through the slider below and embed it into the empty slot on the right to complete the verification. To automate this verification process, the key point is to determine the distance the slider slides. According to the above analysis, the key point of verification is to determine the sliding distance of the slider. But a seemingly simple requirement is not simple to complete. If you use natural logic to analyze this process, it can be broken down as follows: 1. Locate the position of the puzzle on the left. Since the shape and size of the puzzle are fixed, you only need to locate the distance between its left border and the left side of the background image. (Actually, in this example, the starting position of the puzzle is also fixed, saving

Efficiently crawl web page data: combined use of PHP and Selenium Efficiently crawl web page data: combined use of PHP and Selenium Jun 15, 2023 pm 08:36 PM

With the rapid development of Internet technology, Web applications are increasingly used in our daily work and life. In the process of web application development, crawling web page data is a very important task. Although there are many web scraping tools on the market, these tools are not very efficient. In order to improve the efficiency of web page data crawling, we can use the combination of PHP and Selenium. First, we need to understand what PHP and Selenium are. PHP is a powerful

How to install selenium in pycharm How to install selenium in pycharm Dec 08, 2023 pm 02:32 PM

Steps to install selenium with pycharm: 1. Open PyCharm; 2. Select "File", "Settings", "Project: [Project Name]" in the menu bar; 3. Select Project Interpreter; 4. Click on the right side of the tab "+"; 5. Search for selenium in the pop-up window; 6. Find selenium and click the "Install" button next to it; 7. Wait for the installation to complete; 8. Close the settings dialog box.

How to use Selenium to crawl web page data in Python How to use Selenium to crawl web page data in Python May 09, 2023 am 11:05 AM

1. What is Selenium Web crawler is a very useful technique in Python programming, which allows you to automatically obtain data on web pages. Selenium is an automated testing tool that can simulate user operations in the browser, such as clicking buttons, filling out forms, etc. Unlike commonly used crawler libraries such as BeautifulSoup and requests, Selenium can handle content dynamically loaded by JavaScript. Therefore, Selenium is a very suitable choice for data that needs to be obtained by simulating user interaction. 2. Install Selenium To use Selenium, you need to install it first. You can use the pip command to install

See all articles