selenium manager user guide.md

The Selenium community recently released the Selenium Manager tool, mainly to solve the pain point of re-downloading the driver every once in a while. Of course, this is also my pain point. Because the chrome browser will automatically update, I used to turn off the automatic update to avoid the problem of downloading the new driver. However, because most of the user's versions are relatively new, the test browser still needs to be updated every once in a while. It's better just once. I tried it myself, and it feels pretty good. One very interesting point is that sm is actually developed by rust. In my impression, this kind of command line that does not have particularly high performance and stability requirements is developed and maintained with go. Efficiency could be a little higher. The following is the translation of the official blog and a little bit of my own experience.

Most people's first experience with Selenium will be an error message like this:

java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://chromedriver.chromium.org/. The latest version can be downloaded from https://chromedriver.chromium.org/downloads

They then had to search the web for instructions on what to do with the drivers they downloaded.

Selenium: Now with built-in drivers!

The Selenium project wants to improve the user experience, and one of its top priorities is to help all users simplify the way they set up their environments. For many years, configuring browser drivers has been a task that users need to perform in order to run Selenium.

Setting up a browser driver once is not that complicated, but with browser release cycles shortening, there is now a new Chrome/Firefox/Edge version every 4-6 weeks, making keeping browser drivers in sync with browser versions The task is not so easy.

Selenium Manager is a new tool that helps to easily get the working environment needed to run Selenium. Selenium Manager Beta 1 will configure browser drivers for Chrome, Firefox or Edge if they are not in the PATH.

To use Selenium 4.6 for Selenium testing, all you need is Chrome, Firefox or Edge. This feature is ignored if you have already installed the browser driver. If you want to help us test it, please remove your driver or remove the 3rd party driver manager, then things should still "just work". If that doesn't work, please file a bug report.

Future versions of Selenium Manager will even download the browser if necessary.

Inspired by open source and the Selenium community

Selenium Manager is not a completely new solution. Over the years, several third-party projects have emerged in the Selenium ecosystem, such as: WebDriverManager for Java, webdriver-manager for Python, webdrivers for Ruby, and WebDriverManager.Net for C#.

All of these projects serve as inspiration and a clear indication that the community needs this functionality built into Selenium. Also, a survey conducted in January 2021 revealed that most Selenium users want to get rid of driver management issues. Also, the driver installation page is the most visited page in the Selenium documentation.

Introducing Selenium Manager in detail

Selenium Manager is a command-line tool developed in Rust language that runs on multiple platforms. In its beta 1 release, the Selenium Manager will be invoked transparently by the Selenium bindings if no browser driver is detected or a third-party driver manager is not used. You can also use Selenium Manager without Selenium bindings. Currently, the binaries can be found directly in Selenium's code repository. Run the following command to check different parameters and options:

$ ./selenium-manager --help

Here's a quick example showing how to configure ChromeDriver:

$ ./selenium-manager --browser chrome
INFO /home/boni/.cache/selenium/chromedriver/linux64/106.0.5249.61/chromedriver

If you maintain a WebDriver-based project and want to use Selenium Manager at the same time, please join our community channel and we will be happy to help. If you're interested in contributing, check out the project's README for detailed instructions and information.

Future plan

Selenium Manager will continue to be developed in the future, with each release adding new features and fixing bugs. However, you, as a member of the Selenium community, are a key part of the future success of this new tool. Please report ideas or bugs via our issue tracker and join the discussion via our community channel. Looking forward to your feedback!

Happy testing!

simple experience

Download address: https://github.com/SeleniumHQ/selenium/tree/trunk/common/manager

selenium manager is a command line tool, so it must be used in the command line, the following is the help option.

selenium-manager -h
selenium-manager 1.0.0-M3
Selenium Manager is a CLI tool that automatically manages the browser/driver infrastructure required by Selenium.


Usage: selenium-manager [OPTIONS]
Options:
  -b, --browser <BROWSER>
          Browser name (chrome, firefox, edge, iexplorer, safari, or safaritp)
  -d, --driver <DRIVER>
          Driver name (chromedriver, geckodriver, msedgedriver, IEDriverServer, or safaridriver)
  -v, --driver-version <DRIVER_VERSION>
          Driver version (e.g., 106.0.5249.61, 0.31.0, etc.)
  -B, --browser-version <BROWSER_VERSION>
          Major browser version (e.g., 105, 106, etc. Also: beta, dev, canary -or nightly- is accepted)
  -P, --browser-path <BROWSER_PATH>
          Browser path (absolute) for browser version detection (e.g., /usr/bin/google-chrome, "/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome", "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe")
  -O, --output <OUTPUT>
          Output type: LOGGER (using INFO, WARN, etc.), JSON (custom JSON notation), or SHELL (Unix-like) [default: LOGGER]
  -p, --proxy <PROXY>
          HTTP proxy for network connection (e.g., https://myproxy.net:8080)
  -t, --timeout <TIMEOUT>
          Timeout for network requests (in seconds) [default: 120]
  -D, --debug
          Display DEBUG messages
  -T, --trace
          Display TRACE messages
  -c, --clear-cache
          Clear driver cache
      --driver-ttl <DRIVER_TTL>
          Set default driver ttl [default: 86400]
      --browser-ttl <BROWSER_TTL>
          Set default browser ttl [default: 0]
      --clear-metadata
          Clear metadata file
  -h, --help
          Print help
  -V, --version
          Print version

General usage, specify the browser path and driver type, automatically download and configure the driver. I also tried to use the version number of the browser to formulate, but it doesn't seem to work.

In addition, this tool conflicts with ruby's webdrivers extension, so you can choose one of the two.

# windows可以用这个路径: "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe" 
./selenium-manager -d chromedriver -P /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome 

Finally: The following complete software testing video learning tutorial has been sorted out and uploaded. Friends can get it for free if they need it [Guaranteed 100% free]

insert image description here

Software Testing Interview Documentation

We must study to find a high-paying job. The following interview questions are the latest interview materials from first-tier Internet companies such as Ali, Tencent, and Byte, and some Byte bosses have given authoritative answers. Finish this set The interview materials believe that everyone can find a satisfactory job.

picture

Guess you like

Origin blog.csdn.net/weixin_50829653/article/details/130648872