Grid 2 and specific proxy to trace command

78 views
Skip to first unread message

Arnaud Garandeau (SWID)

unread,
Feb 6, 2013, 4:05:51 AM2/6/13
to seleniu...@googlegroups.com
Hello,

 I want to trace all commands in a bdd with a custom Selenium Grid 2 Proxy class.
 I write a Java class and override afterCommand method and I get the request information but I want to convert it in more readable information (to have the command name) :

exemple :
 - with request object, i have : [23 janv. 2013 18:07:14] POST /session/d514c641-5d7a-499d-9b5b-bfd9e169b5c9/element/0/value   {"id":"0","value":["hotel"]}
 - but i want convert this information to  : Executing: [send keys: 0 org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement@3fef64bb, [hotel]] at URL: /session/78997cb4-df15-4fa6-a27d-a6390ccb843f/element/0/value)

How i can do this ?

Thanks you for advance,
Arnaud

François Reynaud

unread,
Feb 6, 2013, 4:40:44 AM2/6/13
to seleniu...@googlegroups.com
Event firing web driver is a client implementation. That information is never sent to grid. What info do you need in the request exactly ?


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/L7tpeVXnXzsJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Arnaud Garandeau (SWID)

unread,
Feb 6, 2013, 4:53:50 AM2/6/13
to seleniu...@googlegroups.com
I need the command information, by example, click, send keys, find element, implicitly wait.

I have to save in my bdd, the same value as Selenium 1 (command, param1, param2) but by using WebDriver.

It's possible ?
Arnaud.

François Reynaud

unread,
Feb 6, 2013, 5:10:18 AM2/6/13
to seleniu...@googlegroups.com
that should be available in the before and after command listeners.

  public void beforeCommand(TestSession session, HttpServletRequest request,
      HttpServletResponse response)
SeleniumBasedRequest r = (SeleniumBasedRequest)request;
r.getBody will contain the info you're looking for.



To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/rBNC5CrKF_4J.

Arnaud Garandeau (SWID)

unread,
Feb 6, 2013, 5:42:02 AM2/6/13
to seleniu...@googlegroups.com
Thank you to retrieve information in request body.

But how can a convert the request info :
 - /session/e0a17dcf-24dc-474b-b7c4-cfa8331b550c/element   {"using":"id","value":"quoiqui"}
 - and /session/2e61e3e0-32fe-45ae-9207-58ae236b68d7/element/0/value {"id":"0","value":["hotel"]}

To explicit information :
 - command = send keys 
 - param1 = by.id quoiqui
 - param2 = hotel

Arnaud

Krishnan Mahadevan

unread,
Feb 6, 2013, 7:19:23 AM2/6/13
to seleniu...@googlegroups.com
Arnaud,
As Francois suggested, if you are basically looking at capturing 


Operation (click, type etc.,)
Locator being used (xpath, id, name etc)
Value (in the case of textboxes )

You should ideally be using the EventFiringWebDriver

This gives you the capability of hooking in event listeners that get invoked *before* and *after* a WebDriver operation [click, type etc.,] happens.

When you can get all of this information from the client side itself why would you be exploring the Proxy capabilities in the Grid ?
[Yes it makes sense if you want to capture even the actions triggered by Actions, because EventFiringWebDriver DOESNOT capture this information]

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/


To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/nr-UWZyEZ0QJ.

François Reynaud

unread,
Feb 6, 2013, 8:14:54 PM2/6/13
to seleniu...@googlegroups.com
the list of all the possible command, and all their param are documented here :
http://code.google.com/p/selenium/wiki/JsonWireProtocol

Arnaud Garandeau (SWID)

unread,
Feb 8, 2013, 12:02:57 PM2/8/13
to seleniu...@googlegroups.com
Thank you François for your reply, I try in this way.
Reply all
Reply to author
Forward
0 new messages