seleniumkit / selenograph

Powered version of Selenium Grid Router
Other
42 stars 14 forks source link

Resolve node hostname/IP #8

Open Shnitzelil opened 8 years ago

Shnitzelil commented 8 years ago

On previous build (1.0) we used this API /api/selenograph/map/HubBrowserState (thanks to @smecsia ) to get the hub hostname and then we used code very like the one in this link to extract the node hostname/ip

After moving to 1.1 we saw that the API above moved out...

Any alternative?

smecsia commented 8 years ago

@Shnitzelil Unfortunately, the only alternative for now is to make a query directly to db collection named sessions. It contains all the session info, including the selected route (hub):

selenograph:PRIMARY> db.sessions.find({_id: "ac84a55cf536a89dc8ed89b1f559da9fa3ba3311-ef05-2519-d037-311e54f9193c"})
{  
   "_id":"ac84a55cf536a89dc8ed89b1f559da9fa3ba3311-ef05-2519-d037-311e54f9193c",
   "object":[  
      "ru.qatools.selenograph.gridrouter.StartSessionEvent",
      {  
         "timestamp":NumberLong("1469449038415"),
         "browser":"android-999",
         "version":"19.0",
         "user":"serp",
         "route":"http://android-x86-999.vm.com:4444",
         "sessionId":"ac84a55cf536a89dc8ed89b1f559da9fa3ba3311-ef05-2519-d037-311e54f9193c"
      }
   ]
}