Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I want to click at x, y coordinates like 52, 216-52, 295. How can this be done using selenium. I am using Mac OSX 10.8.5 with Selenium 2.40.0 and Firefox version 29.0

share|improve this question

1 Answer 1

You can move the mouse and click with Actions, given you have a element to offset from. You cannot click outside the browser content window or control Operating System elements.

moveToElement(WebElement toElement, int xOffset, int yOffset)
Moves the mouse to an offset from the top-left corner of the element.

The code (Java) would look like this:

Actions builder = new Actions(driver);

builder.
   .moveToElement(knownElement 10, 25 );
   .click()
   .build().perform();
share|improve this answer

Your Answer

 
discard

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.