Manage Selenium Grid queue - selenium

I have 1 grid hub server and 3 selenium nodes.
I would like to execute multiple test suite against one Grid Hub server.
So that each test suite will be executed on all 3 servers and the rest of the test suits (pending) will wait till the current test suite will finish its execution.
Can the Grid Hub manage a queue of the test suits?
If no, is there any workaround or another solution?

TLDR; - Yes. Grid can manage.
Long answer
Selenium Hub doesn't care about whether the requests are coming from 3 different test suites or one. Think about it in this way - Hub will process all the requests that comes to it. When a request comes, hub will see if there is a node that has the capability to execute the request.
If there is one available and free, it will send the command to the node.
If there is a node which can execute the request but is busy now, it will send the command to the queue.
If there are no nodes which has the requested capability, the request is marked as failed.
Hub doesn't check for the source of request anywhere in the above flow.

Related

Get total network bytes sent/received during a (proxied) Selenium / ChromeDriver session

I'm running Selenium + ChromeDriver on multiple threads. Each thread starts a separate ChromeDriver, which operates through a fresh proxy.
The solution is consuming way more network-bandwidth than I was expecting (as measured by logging into my proxy-provider and inspecting my GB-used), so I want to figure out which stages in my automation are responsible.
The proxy-provider doesn't provide any way for reporting how much network traffic a connection is using.
It would be great if there was some way of querying the WebDriver for the number of bytes it has sent/received since creation.
Is this possible?

Getting connection timeout error in jmeter distribution testing while clicking remote start all but scripts r working fine normally

Os:Windows
Machines:vdi, remote machines
Getting connection timeout error in jmeter distribution testing while clicking remote start all but scripts r working fine normally
If you're getting connection timeouts between JMeter master and slaves - check your JMeter instances RMI configuration
JMeter master should be able to connect to the slaves to transfer the .jmx script to them
JMeter slaves should be able to connect to the master to transfer the test results back
If you're getting connection timeouts as the result of your Samplers it might be the case that your application under test gets overloaded because if you have 100 user in Test Plan and 1 slave - it will kick off 100 users, each additional slave will add 100 more users so if you have 10 slaves it will be 1000 users. Check Active Threads Over Time Listener (can be installed using JMeter Plugins Manager) to see what is perceived load you generate
Invest into learning some English or if you know it better than me consider changing the way you're asking for help b'cause u r not # Tinder. How do I ask a good question? is a very good place to start.

What ports does Selenium grid uses for heartbeat signals?

I am trying to setup a testing environment using Selenium grid. The hub is to be running on an AWS computer while the nodes would be executed on AWS Workspaces. At this point, nodes can register in the hub, but about one minute latter, the hub complains stating:
Marking the node http://192.168.x.x:1444 as down: cannot reach the node for 2 tries
I have been doing some research and the problem seems to be that the hub sends heartbeat signals that do not reach the nodes and then it drops the session. Since there is a firewall that might be blocking the heartbeat signals, I need to know which ports are used to send such signals in order to configure the firewall accordingly.
Thank you

Checking ActiveMQ queue is empty from JMeter

I am running a performance test using JMeter for our application and the there is some asynchronous processing in the form of events on an ActiveMQ queue. I want to wait for the ActiveMQ queue to be empty before recording the statistics for my test. Is there a good way to do that?
I have explored the JMS Producer/Consumers in JMeter 2.10 but they consume messages off the queue which is not what I want as it modifies the original flow of the application. Is there a way to monitor the draining of the queue without consuming the messages of ActiveMQ?
I am using ActiveMQ 5.8 and JMeter 2.10
I was able to monitor ActiveMQ using the HTTP Request to poll the ActiveMQ web console and get the state of all the queues in XML format. After that I used XPATH to extract the size of the queue I was interested in. The snapshots below show the configuration which I was finally able to use. The XPATH expression which I used was
/queues/queue[#name='${queueName}']/stats/#size
One additional thing which I has to do was to setup basic HTTP authentication to be able to connect to the ActiveMQ web console.
The MBean solution by Mahesh should also work if JMX is enabled on the server but it is not enabled by default.
I have documented it in detail here
You can get the pending messages in that queue using the MBean
"org.apache.activemq:BrokerName=host1,Type=Queue,Destination=dest1"
attribute: "QueueSize"
After checking once every few seconds and the value being not more than zero, you can start recording the statistics.
You can create a simple Java class that consumes all messages from the queue. JMeter can run it before tests.

How do I detect a network timeout of grid requests after starting a Sauce test?

How do I detect a network timeout of grid requests after starting a Sauce test using the RemoteWebDriver client object? I have a scenario that I want my framework to catch and that is that when connectivity outwards to SauceLabs is working but the connectivity back fails. In other words, this is a network scenario where my Selenium test sends a browser .get() and opens a new browser in SauceLabs with a new URL but then, because of a network issue the subsequent JSON packets fail and the tests appears to hang. I know what the problem is but I just want my unit test framework to report the network issue. Right now the RemoteWebDriver will timeout indefinitely when this condition occurs and that is not acceptable.
I know that to solve this will require an understanding of how the client side timeout works when a RemoteWebDriver client initially tries to send JSON commands to the Grid Hub.
I know I can specify the timeout when starting the Grid but similar options do not appear to be on the client side?
Hub start :- java -jar /tools/grid/selenium-server-standalone-2.35.0.jar
-role hub -maxSession 20 -browserTimeout 240
-remoteControlPollingIntervalInSeconds 180 -sessionMaxIdleTimeInSeconds 240
-newSessionMaxWaitTimeInSeconds 250 -timeout 30
Setting an idle timeout on the Sauce end might help with this: http://saucelabs.com/docs/additional-config#idle-timeout
This desired capability (set by default at 90 seconds) times out if no commands are received from your Selenium script.
While it can't detect network issues directly, this could prevent your minutes from being eaten by blocked responses.
You might also benefit from Sauce Connect (https://saucelabs.com/docs/connect), a free, standalone Java utility that enables you to test against firewalled resources. Connect also checks for dropped packets, and will automatically resend them (up to a certain point) in an attempt to re-establish the connection.