Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

O hai SQA, first post here.

I just started using Selenium a few days ago. However, I'm a little stumped getting it to work with one of my projects.

I have an HTML file containing a collection of images. Each image has an event handler, which calls a JavaScript function when I click the image, or press Enter after selecting it with the arrow keys.

However, Selenium doesn't recognize any interaction (mouse clicks or key presses) with the images no matter what I do, although I can get it to work with other sites. The "collage" is JavaScript-generated as opposed to being coded in pure HTML, although I'm not sure if that makes a difference. Any help would be appreciated.

share|improve this question
Since you have started with Selenium, can you try Selenium 2 (aka WebDriver) API for click operation - – Tarun Aug 13 '12 at 5:35
I have faced an issue similar to this before? Check out this question:… – Suchit Parikh Oct 13 '12 at 22:12

how is the event triggered? does the element have an attribute say onclick?

another way to trigger javascript is to use the following example, which is more of a workaround.

WebDriver driver; // Assigned elsewhere
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("return document.title");
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.