How to use Robot Class in Webdriver plugin

180 views
Skip to first unread message

raghavendra chilakalapudi

unread,
Jul 15, 2015, 6:14:08 AM7/15/15
to jmeter-...@googlegroups.com
Hi

I need to use java.awt.robot class in Webdriver plugin.
Can anybody help?

gli...@gmail.com

unread,
Jul 15, 2015, 8:38:03 AM7/15/15
to jmeter-...@googlegroups.com
You can use Robot class just like any other Java SDK class (or in fact any class which is in JMeter's CLASSPATH)

Something like:

var robot = new java.awt.Robot()
robot
.keyPress(65)
robot
.keyRelease(65)
java
.lang.Thread.sleep(5000)

will type "a" letter to the window which is currently in focus. 

65 - is the value of KeyEvent.VK_A field, see KeyEvent JavaDoc for all the possible values. 

More information on WebDriver Sampler plugin advanced usage can be found in The WebDriver Sampler: Your Top 10 Questions Answered guide.

raghavendra chilakalapudi

unread,
Jul 15, 2015, 8:42:33 AM7/15/15
to jmeter-...@googlegroups.com
Thanks for the reply.
Now i am able to use robot class.


--
You received this message because you are subscribed to a topic in the Google Groups "jmeter-plugins" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jmeter-plugins/Lps4AnhFisY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jmeter-plugin...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages