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.

Recommended Answers

All 4 Replies

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

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

commented: thanks for link +1 +11

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?

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.