Running testng suite on selenium grid and docker

怎甘沉沦 提交于 2019-12-12 04:23:52

问题


I created a Selenium hub and 3 chrome nodes using docker. i can see the 3 chrome instances are up and running in the docker

Now how do i stress test a web application. please suggest the steps to run test on selenium grid inside the docker.


回答1:


You may start with this simple Python test

#!/usr/bin/env python2.7

SELENIUM_HUB = 'http://localhost:4444/wd/hub'

from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
driver = webdriver.Remote(
  command_executor=SELENIUM_HUB,
  desired_capabilities=DesiredCapabilities.CHROME,
)

driver.get('http://www.google.com')
print(driver.title)


来源:https://stackoverflow.com/questions/39347404/running-testng-suite-on-selenium-grid-and-docker

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!