SeleniumHQ / selenium-google-code-issue-archive

Archive, please see main selenium repo
https://github.com/seleniumhq/selenium
346 stars 194 forks source link

API for GRID to reserv nodes for multibrowser tests. #3633

Closed lukeis closed 8 years ago

lukeis commented 8 years ago

Originally reported on Google Code with ID 3633

If I wanna test user interactions on the web application under test I need multiple
independent webdriver instances in the same time from the same test method.
The problem is parallel execution of these tests. If I cant guarantee at the beginning
of the test that I will have the resource (enough free browsers) than random timeouts
may occur. 

For clarification of the problem:
Lets say I have 2 nodes capable of run a total of 6 browsers.
Multiple independent CI jobs are sending new browser requests to the grid where the
nodes are registered.
If a job alone starts to run 6 test method in parallel each sending 2 new browser request
to the grid it may occur that all method get  the first browser in the same time, but
all will also time out because cant start the second instance.
A job itself can handle this by limiting the threads of the execution and counting
browser numbers for each test method before executing it.
But independent jobs cant have the shared place for their execution stack, its place
would be in the grid that coordinates request and free browser pairing. 

Without such a feature on my CI server the job execution must be go on sequentially.

I expect the api something like this:
R is the test runner machine G is the Grid server

 - R sends request to G with a unique (generated) request ID to free up N browsers
(than waits for a response)
 - G start to reserve free browsers for R and sends response when all N available,
OR immediately if wont ever available (not enough registered executor)
 - R starts sending new browser requests to G with the same ID
 - G counts these requests and remove reservation of these browsers when all was started
OR timeout occurred OR R sent a free up command with the given ID (when error occurred
in the test and wont need more browser to start)

Reported by ferenc.lombai on 2012-03-29 15:35:30

lukeis commented 8 years ago
this is a very specific scenario that isn't compatible with grid by design. Grid is
running independent tests in parallel, making sure the tests doesn't interact with
each other.
For your specific use case, you should probably start the number of driver you need
manually, without using the grid at all.

Reported by francois.reynaud on 2012-04-16 14:51:59

lukeis commented 8 years ago
I understand that this is somewhat specific. But I don't see why this got a wont fix
flag instead of a feature request. Simulating a user or simulating multiple users behind
multiple browsers is still the same: a test case. Its not stress test its still functional
test case.
If selenium is developed for automated tests sooner or later it will need to support
the capability to mimic the interaction of the users through the application under
test.
Please reconsider your decision.

Reported by ferenc.lombai on 2012-04-16 15:12:59

lukeis commented 8 years ago

Reported by luke.semerau on 2015-09-17 18:15:09