在硒网格和docker上运行testng套件

在硒网格和docker上运行testng套件

问题描述:

我使用docker创建了一个Selenium集线器和3个chrome节点.我可以看到3个chrome实例已在docker中启动并运行

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

现在,我如何对Web应用程序进行压力测试.请提出在docker内部的硒网格上运行测试的步骤.

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

您可以从此简单的Python测试开始

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)