Now I use this to run tests. I pass in the command line the name of the browser and the number of help streams. pytest-xdist
def __init__(self, browser):
desired_capabilites = None
comand_executor = "http://localhost:4444/wd/hub"
if browser == "chrome":
desired_capabilites = {
"browserName": "chrome",
"maxInstances": 5
}
elif browser == "firefox":
desired_capabilites = {
"browserName": "firefox",
"maxInstances": 5
}
self.driver = webdriver.Remote(
command_executor=comand_executor,
desired_capabilities=desired_capabilites)
But this method, it seems to me, has several drawbacks:
- Before launch, always start * selenium-server * (
java -jar selenium-standalone-server.jar) - To test everything in different browsers - I have to run tests twice (one for chrome, second for ff)
Is it possible to automate server startup somehow?
And how to run tests in parallel in different browsers?
An excellent option would be to create two nodes and run tests simultaneously in both. Or create several different browsers in one node and launch them already. But I dont know how. Thanks in advance for your help