What happens when the X & Y co ordinates changes in the application

Asked by Anil

Hi,

 I am using Sikuli, to identify objects in the applets. But while ruinning the selenium script, observed selenium does the operations based on X & Y co ordinates. when browser settings gets changed, X Y coordinates of objects may differ from the initial ones stored.

 Please help me if there is a solution to this? Thanks in advance for your answer.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Roman Podolyan
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

It is never a good idea, to use absolute (x,y) values, if these might change somehow. If the images stay the same, but only its position varies, then you always have to start a new search sequence beginning with some fixed image or position.

nevertheless itis not really clear what you mean. Do you have a sample code?

Revision history for this message
Roman Podolyan (podolyan-roman) said :
#2

Can you provide more details? It is not clear what you want to get. Sikuli is about visual search, so if some objects has different screen coordinates, it can still be found.

When I'm using Sikuli for tests on iPad simulator, I don't care much about _initial_ simulator screen coordinates. I throw Hover search for the distinct simulators visual element, read mouse pointer coordinates from there, and resolve "zero point" on start of every test run from what it reads.

Revision history for this message
Anil (testing4anil) said :
#3

Hi,

 In our web application, there is a built in Java Applet avaialble. Till now i am using QTP as the tool for automation. Going forward we need Selenium to automate our applications.

 I came to know using sikuli, selenium can recognize the objects in Appelt pages. Since Sikuli recognizes the objects based on X&Y co ordinates and our application is web application, i have following questions:

1) Is there a solution to recognize the objects, when X Y co ordintes gets changed?

2) Is there a way to get the properties of the objects using Sikuli?, so that even X Y values gets changed, selenium can still recognize the object.

Revision history for this message
Best Roman Podolyan (podolyan-roman) said :
#4

> 1) Is there a solution to recognize the objects, when X Y co ordintes gets changed?

Sikuli is visual search/recognition tool. It finds visual objects even if their coordinates get changed. Try experiment with "hover" or "click" a bit, moving some visual button.

Look here, for example - http://3.bp.blogspot.com/-javapqYyQ14/TeuXSdZsBcI/AAAAAAAAAkA/9GI0GwbDp7I/s1600/Sikuli.png

See that? Image-based clicking, not coordinates-based.

> Is there a way to get the properties of the objects using Sikuli?, so that even X Y values gets changed, selenium can still recognize the object.

You can click objects, but AFAIR you can't get their properties, Sikuli doesn't have interfaces to objects like WebDriver does.

But Sikuli and Selenium can be used together - http://www.8bitavenue.com/2012/04/sikuli-selenium-robot-framework-integration/#

Revision history for this message
Anil (testing4anil) said :
#5

Thanks Roman Podolyan, that solved my question.