Rajnish Kumar
Rajnish Kumar

Reputation: 2938

How to use java robot class on remote machine

Hi i am using selenium grid to run my test everything is running fine.my application is using maps (like google map) and to perform some action on the map i have used java robot class. the problem is when i run my test case on the local machine everything including robot works great but when i run same test case over grid on different nodes everything is working fine except robot class which performs the action on local machine not on the node machine i.e i can clearly see mouse go up and down on my hub machine but not on the node plz help what to do

Upvotes: 2

Views: 2883

Answers (1)

Krishnan Mahadevan
Krishnan Mahadevan

Reputation: 14746

Here's how you would go about doing it :

  1. Refer here and build a customised servlet which leverages Robot libraries and tie it to a GET method in the servlet and add it up to the node startup.
  2. The servlet's GET method would basically trigger Robot libraries and cause it to perform Robot powered actions.
  3. Refer to this blog post of mine to get to know the IP and Port of the node which is servicing the current automation test session.
  4. Now form a URL by referring to the IP and Port obtained from [3] and form a URL such as this : http://123.xxx.xxx.xxx:1234/extra/RobotActions

In the above URL, "123.xxx.xxx.xxx:1234" would be the IP and port number extracted from step [3]. By default, all custom node level servlets are added under the path "/extra" and RobotActions would be the name of the servlet that you would have built in step (1).

Upvotes: 1

Related Questions