[英]Getting grid (hub-node)information from selenium
Java中是否有用于硒的API来获取中心节点详细信息,我的意思是获取活动节点的数量,IP地址,每个节点中配置的浏览器等。
Here, I got one solution. 在这里,我有一个解决方案。 It works only if you know the hub & node machine url
仅当您知道集线器和节点机器的URL时它才起作用
Object object= client.getForObject(baseUrl+"/grid/api/proxy?id="+ipaddress[i], Object.class); 对象object = client.getForObject(baseUrl +“ / grid / api / proxy?id =” + ipaddress [i],Object.class);
Here client is an instance of RESTTemplate class of spring frame work. 这里的客户端是Spring框架工作的RESTTemplate类的实例。 BaseUrl:_url of hub ipaddress[i]:-Node machine IP.
集线器ipaddress [i]的BaseUrl:_url:-节点机器IP。
Result should be like 结果应该像
<200 OK, { success=true, msg=proxy found !, id=http://192.168.3.37:5555, request={class=org.openqa.grid.common.RegistrationRequest, id=null, name=null, description=null, configuration={port=5555, servlets=[], host=192.168.3.37, Dwebdriver.ie.driver=C:\Anoop\IEdriver\IEDriverServer.exe=, cleanUpCycle=5000, Dwebdriver.chrome.driver=C:\Anoop\chromeDriver\chromedriver.exe=, browserTimeout=0, hubHost=localhost, registerCycle=5000, capabilityMatcher=org.openqa.grid.internal.utils.DefaultCapabilityMatcher, newSessionWaitTimeout=-1, hub=http://localhost:4444/grid/register, url=http://192.168.3.37:5555, remoteHost=http://192.168.3.37:5555, register=true, throwOnCapabilityNotPresent=true, nodePolling=5000, proxy=org.openqa.grid.selenium.proxy.DefaultRemoteProxy, browser=browserName=firefox, maxSession=5, role=node, jettyMaxThreads=-1, hubPort=4444, timeout=300000}, capabilities=[{seleniumProtocol=WebDriver, platform=WIN8_1, browserName=firefox}, {seleniumProtocol=WebDriver, platform=WIN8_1, browserName=chrome}, {seleniumProtocol=WebDriver, platform=WIN8_1, browserName=internet explorer}]}},{Content-Type=[application/json;charset=UTF-8], Content-Length=[1185], Server=[Jetty(7.x.y-SNAPSHOT)]}>
curl http://myhub.com:4444/grid/api/proxy?id=http://172.22.25.164:5555
172.22.25.164 - ip of selenium node 172.22.25.164-硒节点的IP
output >>> 输出>>>
{"success":true,... }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.