Hi all,
I have seen the screencast of image recognisation. Its very helpful thanks for it.
But my question it how will we execute the same thing via Code Module.
Can you post the code here.
Thanks in advance.
Image recognisation and validation
Re: Image recognisation and validation
Hello,
Have a look at http://www.ranorex.com/support/user-gui ... html#c3325
Is it what you were looking for ?
Regards
Swis
Have a look at http://www.ranorex.com/support/user-gui ... html#c3325
Is it what you were looking for ?
Regards
Swis
A simple thank you always does wonders !
-
- Posts: 76
- Joined: Fri Mar 14, 2014 2:37 pm
Re: Image recognisation and validation
Nope buddy the guide did not help me a lot.
I want to get a image and create a small rectangle out of it and than check whether the image contains the small rectangle or not.
Can anyone help me with the code out here.
Thanks in advance,
Deepak
I want to get a image and create a small rectangle out of it and than check whether the image contains the small rectangle or not.
Can anyone help me with the code out here.
Thanks in advance,
Deepak
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Image recognisation and validation
Hello Deepak,
I am not exactly sure if I understand your question correctly. Do you want to draw a rectangle into your image using Ranorex? If yes, unfortunately this is not possible using the Ranorex API, but maybe you can use the .NET Framework to achieve this.
Regards,
Bernhard
I am not exactly sure if I understand your question correctly. Do you want to draw a rectangle into your image using Ranorex? If yes, unfortunately this is not possible using the Ranorex API, but maybe you can use the .NET Framework to achieve this.
Regards,
Bernhard
-
- Posts: 76
- Joined: Fri Mar 14, 2014 2:37 pm
Re: Image recognisation and validation
Hi support team,
Its just that i want to know how to do image based validation for both compare and contains with scripting.
I performed record and play and it was very fine.
But some code in code module starting with #Image
was present how can we do that via scripting is my question.
Thanks,
Deepak
Its just that i want to know how to do image based validation for both compare and contains with scripting.
I performed record and play and it was very fine.
But some code in code module starting with #Image
was present how can we do that via scripting is my question.
Thanks,
Deepak
Re: Image recognisation and validation
Hi Deepak,
It would be easier to help you out if you could post a sample of recorded project describing what you exactly want to achieve. It would be best if you could record a demo with publicly available application (like the KeePass demo included in Ranorex samples).
It would be easier to help you out if you could post a sample of recorded project describing what you exactly want to achieve. It would be best if you could record a demo with publicly available application (like the KeePass demo included in Ranorex samples).
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Image recognisation and validation
Hi Deepak,
Make note, that my experience is this: if something can be done in Ranorex studio, than it can be done from user code also.
Look into image based automation in Ranorex studio: http://www.ranorex.com/support/user-gui ... ation.html
As you will see Ranorex is capable of getting an image of an element, then select the part of an image to be the base of recognition.
Just follow the guide and look at the generated code, so you will have some clue on how to achieve this.
Best Regards,
Zoltán
Make note, that my experience is this: if something can be done in Ranorex studio, than it can be done from user code also.
Look into image based automation in Ranorex studio: http://www.ranorex.com/support/user-gui ... ation.html
As you will see Ranorex is capable of getting an image of an element, then select the part of an image to be the base of recognition.
Just follow the guide and look at the generated code, so you will have some clue on how to achieve this.
Best Regards,
Zoltán
Re: Image recognisation and validation
I think he wants to know if there is a way to automatically (via code) create the "image feature data" section of code, which is automatically added during recording. I believe the answer is no.
Deepak, if you want to use Ranorex in pure coded way, then you would need to code things yourself. You can use the code created by recording, modify it or create your own code based of the recorded code.
Many automation professionals say that they don't use Record feature because they can produce cleaner code and in many cases also faster than using recording (because they don't need to optimize the recorded code). That may be true. But because you are clearly a Ranorex beginner, I would suggest you to use Recording as much as possible. Learn how the things work, what code is created by Recording and then start writing your own code in UserCode.cs or start using Code modules. I see no point in abandoning Recording, because you can learn a lot from the recorded code.
Deepak, if you want to use Ranorex in pure coded way, then you would need to code things yourself. You can use the code created by recording, modify it or create your own code based of the recorded code.
Many automation professionals say that they don't use Record feature because they can produce cleaner code and in many cases also faster than using recording (because they don't need to optimize the recorded code). That may be true. But because you are clearly a Ranorex beginner, I would suggest you to use Recording as much as possible. Learn how the things work, what code is created by Recording and then start writing your own code in UserCode.cs or start using Code modules. I see no point in abandoning Recording, because you can learn a lot from the recorded code.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
-
- Posts: 76
- Joined: Fri Mar 14, 2014 2:37 pm
Re: Image recognisation and validation
Hi odklizec,
Yes exactly I wanted that #image feature data thing via code.
Tried it via code but was not working and giving errors. As you guys already know that I am a beginner of Ranorex but still I believe in coding. For reference I sometimes try Recording but never use them because I think if you ask a small kid to just click Record and Play then he/she will also be able to do, then what is the use of Engineers.
Coming back to the topic. For now as I am not getting any help for Image based automation, I have used some other logic to replace Image based automation and its working fine for me.
But still I would hope that some one could try it via code and post the code here so that all the beginners can find it easy to achieve these tasks(Image based automation via coding).
Regards,
Deepak
Yes exactly I wanted that #image feature data thing via code.
Tried it via code but was not working and giving errors. As you guys already know that I am a beginner of Ranorex but still I believe in coding. For reference I sometimes try Recording but never use them because I think if you ask a small kid to just click Record and Play then he/she will also be able to do, then what is the use of Engineers.
Coming back to the topic. For now as I am not getting any help for Image based automation, I have used some other logic to replace Image based automation and its working fine for me.
But still I would hope that some one could try it via code and post the code here so that all the beginners can find it easy to achieve these tasks(Image based automation via coding).
Regards,
Deepak
Re: Image recognisation and validation
Deepak,
What errors exactly did you get? Are you sure the objects referenced in Image Feature Data code are stored in repository? It would be easier to help you out if you create a small sample project and post it here for review (e.g. using keepass sample app included in Ranorex samples).
I can't be wrong, but I'm almost sure there is no "automatic" way to generate Image Feature Data section from the code (outside Record feature). You simply need to add some images to repository and then code the appropriate content for "Image Feature Data" by yourself.
In my opinion, if Record feature is used wisely, it could save you a lot of time and energy that you would spend with writing every line of code. It's just easier to record small parts of scenario and copy/edit the generated code. This approach is especially handy if you just starting with Ranorex. You can't run before you learn how to walk
What errors exactly did you get? Are you sure the objects referenced in Image Feature Data code are stored in repository? It would be easier to help you out if you create a small sample project and post it here for review (e.g. using keepass sample app included in Ranorex samples).
I can't be wrong, but I'm almost sure there is no "automatic" way to generate Image Feature Data section from the code (outside Record feature). You simply need to add some images to repository and then code the appropriate content for "Image Feature Data" by yourself.
In my opinion, if Record feature is used wisely, it could save you a lot of time and energy that you would spend with writing every line of code. It's just easier to record small parts of scenario and copy/edit the generated code. This approach is especially handy if you just starting with Ranorex. You can't run before you learn how to walk
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration