0

Original title: "performance improvement in selenium server standalone"

We are switching our Ruby-driven automated test grids from a node/hub configuration on our local infrastructure to a standalone configuration in AWS (2.44).

The node/hub setup runs firefox in individual linux instances, but the new configuration runs the full test grid in a single xvfb. It's on a solid AWS infrastructure, but The xvfb/AWS grid is performing more slowly than the old node/hub. Why?

The exception handling seems to be slower with selenium-standalone-server. Manipulating window handles also seems a bit slow:

14:07:23.442 INFO - Executing: [get window handles])
14:07:23.445 INFO - Done: [get window handles]
14:07:23.669 INFO - Executing: [get current window handle])
14:07:23.669 INFO - Executing: [get window handles])
14:07:23.672 INFO - Done: [get current window handle]
14:07:23.672 INFO - Done: [get window handles]
14:07:23.849 INFO - Executing: [switch to frame: null])
14:07:23.852 INFO - Done: [switch to frame: null]
14:07:24.089 INFO - Executing: [get window handles])
14:07:24.090 INFO - Executing: [switch to frame: null])
14:07:24.092 INFO - Done: [get window handles]

A half second just to switch around some windows... How can I improve this performance?

Update: On further inspection, the slowdown seems to be due to network latency between the JVM running the selenium jar and the controlling Ruby selenium code. Running the exact same Ruby code on the same machine as the selenium-server-standalone jar completely eliminates this unexpected latency in the window handling and other tasks.

So the question becomes: how to speed up Selenium if the jar and the controlling code are on different network infrastructures? Is there a way to reduce the network traffic between the jar and controlling code? Or is the only solution to put the controlling code on the same network or machine as the selenium jar?

emery
  • 8,603
  • 10
  • 44
  • 51
  • 1
    Have you looked at your CloudWatch metrics? Anything interesting in CPU or network I/O? Any Firefox CPU spikes? We don't know anything about your EC2 instances or your network infrastructure so this will be hard for an outsider to help with. (BTW 2.44 is pretty old now.) – Andrew Regan Mar 12 '16 at 23:09
  • Thanks Andrew Regan, I will update this question with more detailed information as soon as it becomes available. – emery Mar 14 '16 at 19:44

1 Answers1

1

It turns out that our local Selenium code was communicating with selenium-server-standalone.jar over several firewalls and a large physical distance.

Running both the selenium server and the selenium code which controls the browser under the same network infrastructure has fixed the problem.

emery
  • 8,603
  • 10
  • 44
  • 51