954,545 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how to simulate mouse click anywhere on screen

Well hello, i'm about to start my little app. The only task i want it to perform is a left mouse click on a button on the browser, IE, Firefox, Safari... I wonder if this can be done as the click will be performed outside the program window or frame. The app will run minimized and will simulate a left click on an active window with the coordinates i provide. Can this be done with Java? or do i have to use C as i assume i have to talk to Windows API? Thanks for your time.

stay_alive
Newbie Poster
2 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
 

The Robot class has a method to click anywhere on the screen. Finding the coordinates of the browser's button may be harder...

JamesCherrill
Posting Genius
Moderator
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
 

If you want to just create click on browser you may want to look into Selenium library (nice library used for testing web applications)

peter_budo
Code tags enforcer
Moderator
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
 

I'm looking at Selenium documentation and it says that You can export the recorded test in most language e.g. html, Java , .net , perl , ruby etc. The exported test can be run in any browser and any platform using "selenium remote control" How could that help if the selenium remote control has to be installed on the client's browser?

stay_alive
Newbie Poster
2 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
 

Doesn't need to be installed. You are looking on Selenium IDE that is plugin for browsers and used as easy way to record test. You need to check code base library and then you will be able to monitor events on a browser

peter_budo
Code tags enforcer
Moderator
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: