Java Robot Class Not working.

1,024 views
Skip to first unread message

Shreyas Chaudhari

unread,
Aug 21, 2012, 1:00:03 AM8/21/12
to seleniu...@googlegroups.com
Hi All,

I'm using :

OS - Windows XP.
Selenium Webdriver (2.21).
Scripting Language : Java
Browser : Firefox 8.

I have made use of Robot Class to handle file upload. 
Steps -
1) Click on Browse button using Robot class.
2) Paste the filepath to the Select File Windows Popup.
3) Press Enter using Robot class.

This was fully functional for almost 2 weeks. Yesterday, all of sudden while executing the Tests; are breaking i.e. the KeyPress and KeyRelease Event is not working. 

Robot robot = new Robot();

try{
   robot.keyPress(KeyEvent.VK_TAB);
   robot.keyRelease(KeyEvent.VK_TAB);
}catch(AWTException e){
      e.printstacktrace();
}

Surprisingly, there is no exception thrown. Can you please suggest, how to handle this Robot Class scenario effectively.

Warm Regards,
Shreyas Chaudhari.

Peter Gale

unread,
Aug 21, 2012, 3:33:09 AM8/21/12
to Selenium Users
This is not a forum for Java robot class questions.

But you can upload a file with WebDriver by using "sendkeys" to send to full path of the file you want to up to element that controls the file uploading. The are lots fo posts on this topic if you want more details.


Date: Mon, 20 Aug 2012 22:00:03 -0700
Subject: [selenium-users] Java Robot Class Not working.
From: shreyass...@gmail.com
To: seleniu...@googlegroups.com
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply all
Reply to author
Forward
0 new messages