How to avoid co-ordinate based events which get created by r

Best practices, code snippets for common functionality, examples, and guidelines.
ask007
Posts: 5
Joined: Tue May 03, 2016 10:56 am

How to avoid co-ordinate based events which get created by r

Post by ask007 » Mon May 09, 2016 6:15 am

Hi,
I'm having following doubts
1. How to automate image based test without using recording? Please provide example
2. Is it really necessary to create repo using recording every time? Is there any alternative available?
3. How to avoid co-ordinate based events which get created by recordings?
ex: repo.Open.ButtonOpen.Click("10;4");

Please provide sample code for more understanding

Thanks in advance :D

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to avoid co-ordinate based events which get created by r

Post by Support Team » Tue May 10, 2016 12:19 pm

Hi ask007,

Please find the answers to your questions below.

1) Image Based Automation
Information about image based automation in code modules can be found in our user guide.
Furthermore, I would suggest having a look at the API documentation concerning the Validate.CompareImage() and Validate.ContainsImage() method.

2) Adding Repository Items
UI elements can be added to the repository independently from recording modules. I would recommend having a look at the user guide section about Ranorex Spy.

3) Change Click Location
In order click actions are recorded with the click location 'Center', please change the global setting 'Coordinate recording mode' to 'None'.
coordinate_recording_mode.png
coordinate_recording_mode.png (13.34 KiB) Viewed 610 times
I hope this information will help you.

Sincerely,
Johannes
.
Image

ask007
Posts: 5
Joined: Tue May 03, 2016 10:56 am

Re: How to avoid co-ordinate based events which get created by r

Post by ask007 » Wed May 18, 2016 1:17 pm

Hi,
Thanks for reverting back. I'm having one doubt as-
Cant we avoid coordinates or rectangle itself?
ex:
CompressedImage Client_Screenshot1
{ get { return imagerepo.Photoshop2.ClientInfo.GetScreenshot1(new Rectangle(144, 81, 11, 15));
}
}
How same rectangle coordinates works with diff type of screens?

Support Team wrote:Hi ask007,

Please find the answers to your questions below.

1) Image Based Automation
Information about image based automation in code modules can be found in our user guide.
Furthermore, I would suggest having a look at the API documentation concerning the Validate.CompareImage() and Validate.ContainsImage() method.

2) Adding Repository Items
UI elements can be added to the repository independently from recording modules. I would recommend having a look at the user guide section about Ranorex Spy.

3) Change Click Location
In order click actions are recorded with the click location 'Center', please change the global setting 'Coordinate recording mode' to 'None'.
coordinate_recording_mode.png
I hope this information will help you.

Sincerely,
Johannes

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to avoid co-ordinate based events which get created by r

Post by Support Team » Fri May 20, 2016 1:23 pm

Hi ask007,

The Rectangle object is needed for image based validation in order to know which part of the image needs to be considered.

Please note that if you perform image based automation/validation, you have to make sure that color and resolution settings are the same as on the machine you made the test/recording on.

If you need more information, please do let me know.

Sincerely,
Johannes
.
Image