Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Sheetjs | 32,445 | 4,379 | 2,297 | 22 days ago | 170 | March 24, 2022 | 125 | apache-2.0 | JavaScript | |
📗 SheetJS Spreadsheet Data Toolkit -- New home https://git.sheetjs.com/SheetJS/sheetjs | ||||||||||
Blessed Contrib | 15,048 | 540 | 423 | 18 days ago | 64 | February 17, 2022 | 89 | mit | JavaScript | |
Build terminal dashboards using ascii/ansi art and javascript | ||||||||||
Docker Selenium | 6,625 | 13 days ago | 28 | other | Shell | |||||
Docker images for Selenium Grid | ||||||||||
Blog | 1,521 | a month ago | 36 | JavaScript | ||||||
在这里写一些工作中遇到的前端,后端以及运维的问题 | ||||||||||
Selenium Grid Extras | 513 | 3 years ago | 154 | bsd-3-clause | Ruby | |||||
Simplify the management of the Selenium Grid Nodes and stabilize said nodes by cleaning up the test environment after the build has been completed | ||||||||||
Honeycomb | 513 | 8 | 9 | 2 months ago | 59 | April 24, 2021 | 1 | mit | TypeScript | |
Create hex grids easily, in node or the browser. | ||||||||||
Jpspluswithgoalbounding | 481 | 8 years ago | 5 | C++ | ||||||
JPS+ and Goal Bounding | ||||||||||
Galaxy | 320 | 2 | 1 | 7 years ago | 5 | July 23, 2014 | 17 | lgpl-3.0 | Java | |
A cache-coherent in-memory data grid | ||||||||||
Path_planning | 234 | 4 months ago | bsd-3-clause | C++ | ||||||
This repository contains path planning algorithms in C++ for a grid based search. | ||||||||||
Eppathfinding.cs | 163 | 4 years ago | 24 | December 09, 2017 | 3 | C# | ||||
A jump point search algorithm for grid based games in C# |
Talk 2 Grid is a very simple library that exposes some of the straight forward Http APIs that a Selenium Hub/Node provides.
This library was built with an intention of interacting with the Hub/Node to get some useful information.
Talk 2 Grid requires :
Talk 2 Grid is a Maven artifact. In order to consume it, you merely need to add the following as a dependency in your pom file.
<dependency>
<groupId>com.rationaleemotions</groupId>
<artifactId>talk2grid</artifactId>
<version>1.2.1</version>
</dependency>
The below sample shows how to access the Hub's configuration.
public void showHubConfiguration() {
Host hub = new Host("localhost", "4444");
GridApiAssistant assistant = new GridApiAssistant(hub);
HubConfiguration hubConfig = assistant.getHubConfiguration();
assertEquals("org.openqa.grid.internal.utils.DefaultCapabilityMatcher", hubConfig.getCapabilityMatcher());
}
The below sample shows how to find out the node to which a test was routed to and to retrieve the node's configuration.
public void demonstrateToWhichNodeWasMyTestRoutedTo() throws Exception {
RemoteWebDriver rwd = null;
Host hub = new Host("localhost", "4444");
try {
String url = String.format("http://%s:%d/wd/hub", hub.getIpAddress(), hub.getPort());
rwd = new RemoteWebDriver(new URL(url), DesiredCapabilities.chrome());
//First lets get hold of the session id for our test.
String sessionId = rwd.getSessionId().toString();
GridApiAssistant assistant = new GridApiAssistant(hub);
//Now lets query the Hub to figure out to which node did the hub route our test to.
Host node = assistant.getNodeDetailsForSession(sessionId);
assertNotNull(node);
Reporter.log("Test routed to " + node.toString(), true);
//Lets check what does the node configuration look like.
NodeConfiguration nodeConfig = assistant.getNodeConfigForSession(node);
//Here's how we get hold of the capabilities that are supported by this node.
assertNotNull(nodeConfig.getCapabilities());
} finally {
if (rwd != null) {
rwd.quit();
}
}
}
As we all know the machine on which the Grid hub runs can get pretty chatty very soon when the number of nodes starts increasing.
This is because the Hub is always the single point of mediation between a test and the node on which the test actually runs.
We can however, try and remediate this by enriching the RemoteWebDriver
instance with the ability to toggle between the Hub and the Node when it comes to routing browser interaction messages.
The below code shows you how to do this:
package com.rationaleemotions.webdriver;
import com.rationaleemotions.RemoteWebDriverEnricher;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import java.net.URL;
public class GridGames {
public static void main(String[] args) throws Exception {
RemoteWebDriver driver = null;
try {
driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), DesiredCapabilities.firefox());
driver = RemoteWebDriverEnricher.enrichRemoteWebDriverToInteractDirectlyWithNode(driver);
driver.get("https://the-internet.herokuapp.com/");
System.err.println("Page Title " + driver.getTitle());
} finally {
if (driver != null) {
driver.quit();
}
}
}
}
When you run this, you should see a big warning such as below :
Mar 19, 2017 10:35:28 AM com.rationaleemotions.RemoteWebDriverEnricher enrichRemoteWebDriverToInteractDirectlyWithNode
INFO: Traffic will now be routed directly to the node.
Mar 19, 2017 10:35:28 AM com.rationaleemotions.RemoteWebDriverEnricher enrichRemoteWebDriverToInteractDirectlyWithNode
WARNING: ********************************************************************************
Your Hub URL is [http://localhost:4444/grid/console]
1. It is configured with [1800 seconds] as timeout (via -timeout parameter.)
This means that the server automatically kills a session that hasn't had any activity in the last 1800 seconds.
2. It is configured with [5 seconds] as cleanup cycle (via -cleanUpCycle parameter.)
This means that the hub will poll for currently running sessions every [5 seconds] to check if there are any 'hung' sessions.
Both these values can cause your test session to be cleaned up and cause test failures.
So please ensure that you set the values for both these parameters on the grid to an appropriately higher value.
********************************************************************************
So here are some of the things that you should keep in mind before using this utility to have the browser interactions directly routed to the node. This utility is dependent on two important parameters in the Hub.
-cleanUpCycle
- This parameter represents how often the Hub will poll all the proxies to find out if the sessions in each of the proxies are still active or if they can be cleaned up. So lets say you have set this value to be 5 seconds
and if your test runs for more than 5 seconds
then the Hub will treat your session as inactive (remember we are now by-passing the hub and routing all traffic to the node, so in the hub's perception the session is literally idle/hung) and clean it up. So this value should be set such that its more than the average life-time of a test.-timeout
- This parameter represents the maximum allowed idle time for a session, before which it gets marked as "idle session" and gets cleaned up. Here also the value should be set such that its greater than the average life-time of a test.The below code snippet shows how to upload a file to the remote machine.
import com.rationaleemotions.pojos.Host;
import java.io.File;
import java.net.URL;
import org.openqa.selenium.firefox.FirefoxOptions;
import org.openqa.selenium.remote.RemoteWebDriver;
public class Sample {
public static void main(String[] args) throws Exception {
RemoteWebDriver driver = null;
try {
URL url = new URL("http://localhost:4444/wd/hub");
driver = new RemoteWebDriver(url, new FirefoxOptions());
driver.get("https://the-internet.herokuapp.com/");
Host grid = new Host("localhost", "4444");
GridApiAssistant assistant = new GridApiAssistant(grid);
File fileToUpload = new File("/Users/krmahadevan/grid/foo.txt");
String sessionId = driver.getSessionId().toString();
String fileLocation = assistant.uploadFileToNode(sessionId, fileToUpload);
System.err.println("File uploaded to " + fileLocation);
} finally {
if (driver != null) {
driver.quit();
}
}
}
}