Small knowledge, big challenge! This article is participating in the creation activity of “Essential Tips for Programmers”.

The source code

This is a deep fear of holes, as deep coding for many years of testing, but also often to other students interested in coding, as long as they have a code base, must go to see somebody else’s excellent framework source code, one is to test their ability to master the code, the second is training thinking.

To be qualified for the position of automation test engineer, there must be a certain code base, so it should be easy to read the source code. But when it comes to understanding other people’s minds, it’s not so easy.

selenium

What is Selenium? Selenium Automation browser. That’s it! How you use that power is entirely up to you. It is primarily, but certainly not limited, to automating Web applications for testing purposes. Boring Web-based administrative tasks can (and should) be automated, too. Selenium is supported by some of the largest browser vendors, who have (or are) taking steps to make Selenium a native part of their browsers. It is also the core technology in countless other browser automation tools, apis, and frameworks.

Why do you choose Selenium?

I crudely think that this is a very easy way to get you into automated testing; Learning Selenium can make people grow up quickly and establish the correct thinking of automated testing technology easily.

A couple of things to do first

I’m used to using Python, but Java is not out of the question. The main consideration is readership, as Python is an easy programming language to get started with.

Set up the local development environment
  • Python3 environment

Python2 is not recommended, and don’t ask why, python4 is the next step.

  • IDE editor

Pycharm decided to use Eclipse to write Java scripts.

  • Selenium3 installation

PIP install selenium = 3.14.0

Selenium4 is the latest version of the selenium4. If you do not use the new feature, do not use the latest version

  • Driver Browser driver

We are talking about the source code, can not, but the need for a certain demonstration effect, to meet the conditions

The selenium directory

The top two directories: Common and WebDriver:

The common circled ellipse defines exceptions that can occur during web automation testing, most likely NoSuchElementException

Selenium can also be used to test browser compatibility. The webDriver tool supports running different browsers, such as Chrome, Ie and Firefox.

The remaining three are webDriver/Common, webDriver/Remote, and webDriver /support.

  • Common defines the basic functionality supported by webDriver’s operational browser:

For example, keyboard + mouse button operation, actions, touch_actions, keys

– Remote defines the core functions of WebDriver: it is the main source code analysis object

  • Support defines the auxiliary functions of WebDriver

The commonly said display wait is defined by expected_conditions

Write in the last

Before there is no code base, it is not recommended to rush to look at the source code, but need to solid code base, do not rush to success.

In the analysis of the source code, will be particularly mentioned in the actual use of points may encounter problems, or even strange problems. Mutual encouragement!!