Skip to content

Instantly share code, notes, and snippets.

View dimacus's full-sized avatar

Dima Kovalenko dimacus

  • Novartis Institutes for BioMedical Research
  • Harrisonburg, VA
View GitHub Profile
require 'rubygems'
require 'selenium-webdriver'
driver = Selenium::WebDriver.for(:remote, :url => "http://127.0.0.1:4444/wd/hub", :desired_capabilities => :firefox)
driver.get "http://seleniumhq.org"
sleep 5
driver2 = Selenium::WebDriver.for(:remote, :url => "http://127.0.0.1:4444/wd/hub", :desired_capabilities => :firefox)
GET
/api/v1/hub/config #Grid Hub configuration
/api/v1/proxies #List of all connected proxies
/api/v1/proxies/id #Info on a given connected proxy (Hostname, IP, Version, etc..)
/api/v1/proxies/id/config #Proxy configuration (node.json)
/api/v1/proxies/id/capabilities #Registered capabilities, (Browsers, maxInstances, etc..)
/api/v1/proxies/id/sessions #List of current sessions (possibly previous ones also)
/api/v1/queue #List of new sessions in queue, possibly add DELETE verb to get rid of items in queue that we want removed
trs = selenium.find_elements(:css, "tr");
trs.each -> tr #Storing current loop var in tr
tds = tr.find_elements(:css, "td");
if tds[1] == "user-x"
trs[5].click
def wait_for_ajax
Selenium::WebDriver::Wait.new(:timeout => 60).until do
sleep 1
@selenium.execute_script("return jQuery.active") == 0
end
end
public void waitForAjax() {
#!/bin/bash +e
# allow change to pass-in display argument
DISPLAY=$1
: ${DISPLAY:=:1}
export DISPLAY
echo "=== network before $0 ==="
netstat -na | grep "LISTEN "
echo
#!/bin/bash -e
# allow change to pass-in display argument
DISPLAY=$1
: ${DISPLAY:=:1}
export DISPLAY
echo "Starting VNC server"
vncserver ${DISPLAY} -geometry 1280x1024
{
"capabilities": [
{
"platform": "MAC",
"seleniumProtocol": "WebDriver",
"browserName": "chrome",
"version": 31,
"maxInstances": 3
},
{
{
"theConfigMap": {
"auto_start_hub": "1",
"default_role": "hub",
"node_config_files": [
"node_5555.json"
],
"hub_config": {},
"iedriver": {
"bit": "x64",
class Disappointed
def ಠ_ಠ
puts "DISAPPOINTED!!!"
end
end
1.8.7 :024 > driver = Selenium::WebDriver.for(:remote, :url => "http://10.20.43.98:4444/wd/hub", :desired_capabilities => caps)
Selenium::WebDriver::Error::UnknownError: unknown error
from [remote server] org.openqa.selenium.remote.RemoteWebDriver(RemoteWebDriver.java):600:in `execute'
from [remote server] org.openqa.selenium.remote.RemoteWebDriver(RemoteWebDriver.java):241:in `startSession'
from [remote server] org.openqa.selenium.remote.RemoteWebDriver(RemoteWebDriver.java):226:in `startSession'
from [remote server] org.openqa.selenium.ie.InternetExplorerDriver(InternetExplorerDriver.java):182:in `run'
from [remote server] org.openqa.selenium.ie.InternetExplorerDriver(InternetExplorerDriver.java):174:in `<init>'
from [remote server] org.openqa.selenium.ie.InternetExplorerDriver(InternetExplorerDriver.java):150:in `<init>'
from [remote server] sun.reflect.NativeConstructorAccessorImpl():-2:in `newInstance0'
from [remote server] sun.reflect.NativeConstructorAccessorImpl():-1:in `newInstance'