I'm using Firefox with my test but there is a problem when it comes to clicking flash buttons. I don't have access the source codes of flash elements, so i can't use flash-selenium or anything similar for test.
Currently my solution is getting a screenshot with windows api, and processing the screenshot and defining the button coordinates which I'm supposed to be click on it, then again with windows api clicking on the coordinates.
But in this way, i can't use my computer for anything else and i must wait for interacting pc unlike webdriver's own functions.
I'm trying to do getting a screenshot on Firefox page with webdriver (it's done actually), and getting in that screenshot the area coordinates of flash button and clicking on it without element based because when i use for checking if it's possible selenium ide, it can't click with functions like clickat or i am doing something wrong.
We can use the ClickAt command in Selenium IDE. The ClickAt command has two arguments − the element locator and the coordinates which mentions the x and y coordinates of the mouse with respect to the element identified by the locator.
Selenium executes JavaScript commands with the help of the executeScript method. To get the unique coordinates of an element we shall create an object of the class Point which shall store the location of the webelement obtained from the getLocation method.
We can click a button with Selenium webdriver in Python using the click method. First, we have to identify the button to be clicked with the help of any locators like id, name, class, xpath, tagname or css. Then we have to apply the click method on it. A button in html code is represented by button tagname.
The API syntax for the moveByOffset() method is as follows: public Actions moveByOffset(int xOffSet, int yOffSet) In the preceding code, xOffSet is the input parameter providing the WebDriver the amount of offset to be moved along the x axis.
In Selenium 2 you will be able to simulate moving the mouse to specified co-ordinates and click using the MoveToOffsetAction
in the Advanced User Interactions API. This is currently still in development and not yet supported in the Firefox or Internet Explorer drivers.
More details of the Advanced Users Interactions API can be found on the project's official wiki page: http://code.google.com/p/selenium/wiki/AdvancedUserInteractions
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With