Course at TAU by Andrew Knight: https://testautomationu.applitools.com/selenium-webdriver-python-tutorial/
Documentation in my versions:
- Install python (python 3)
- Install pipenv (pipenv -- version)
pip3 install pipenv
- Then, clone/create project on git.
- Download Chrome Driver
- Open it
- Move to bin :
mv current/chromedriver /usr/local/bin
to bin.
- Download Firefox Driver (geckodriver)
- Open it
- Move to bin :
mv current/geckodriver /usr/local/bin
to bin.
- Download Chrome Driver
- Open project in VS Code.
- Install selenium using pipenv (creates and manages a virtualenv for the projects).
pipenv install selenium
pipenv install pytest
- Create
conftest.py
file for config fixture.- Create web driver instance etc.
- Then always QUIT the instance.
- Add
fixture
to test cases. - Create test file under tests.
- tests/test_search.py
- Start plan/draft test steps
- Try to run test
pipenv run python -m pytest
- If able to open chrome. Mean that the driver set up correctly.
- Note:
- Please manual install pylint
pip3 install pylint
at your terminal. - DO NOT let VScode install for you.
- It locator directory might go wrong. Causing lint can’t import.
- Please manual install pylint
- Use
pytest-xdist
to run test in pararellpipenv install pytest-xdist
- To run it in parallel after install
pytest-xdist
.- Run
pipenv run python -m pytest -n ${number of thread that you want it to run}
- Run