Python 3.9.5 + Pytest project with healenium usage example
2. Configuration RemoteWebDriver for Healenium
Go into healenium folder
cd healeniumNote:
browsers.jsonconsists of target browsers and appropriate versions. Before run healenium you have to manually pull selenoid browser docker images with version specified in browsers.json
Example pull selenoid chrome image:
docker pull selenoid/vnc:chrome_102.0Full list of browser images you can find here
Run healenium with Selenoid:
docker-compose up -ddocker-compose -f docker-compose-selenium-grid.yaml up -dATTENTION
Verify the next images are Up and Running
postgres-db(PostgreSQL database to store etalon selector / healing / report)hlm-proxy(Proxy client request to Selenium server)hlm-backend(CRUD service)selector imitator(Convert healed locator to convenient format)selenoid/selenium-grid(Selenium server)
To run using Healenium create RemoteWebDriver with URL http://<remote webdriver host>:8085:
options = webdriver.ChromeOptions()
options.add_argument('--no-sandbox')
options.add_argument("--disable-dev-shm-usage")
self.driver = webdriver.Remote(
command_executor="http://localhost:8085",
desired_capabilities=webdriver.DesiredCapabilities.CHROME,
options=options)To run tests in terminal with pytest you need to go to execute next commands:
python3 -m venv envsource ./env/bin/activatepython -m pip install -U pytestpython -m pip install -U seleniumpython -m pytest ./tests/If you want to execute tests from specified file, please use the command:
python -m pytest ./tests/test_css.pyIn case you want to run all tests in project use
python -m pytest ./tests/command
You can monitor tests running if you using Healenium with Selenoid plus Selenoid Ui, go to:
http://localhost:8080