Loop problem

Best practices, code snippets for common functionality, examples, and guidelines.
User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Loop problem

Post by odklizec » Tue Feb 13, 2018 2:31 pm

I believe you need to instantiate repo like this:

Code: Select all

public static WM.WMRepository repo = WM.WMRepository.Instance;
Pavel Kudrys
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

yaro2o
Posts: 95
Joined: Mon Jan 29, 2018 11:19 am

Re: Loop problem

Post by yaro2o » Tue Feb 13, 2018 3:09 pm

k now looks like it works thx :)

Another question:

is it possible to add this code globally? so that I do not add it every time in my all testcase? I must put this code in Program.cs ? and then he will look for these popup in all Solution and when they appear they will perform the desired actions?

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Loop problem

Post by odklizec » Tue Feb 13, 2018 3:26 pm

Yep. If you put the popupwatchers in program.cs, then they should catch all watched popups. Another (possibly cleaner) solution is to create a code module with all popupwatchers and place it in the TestSuite [Start] section.
Pavel Kudrys
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

yaro2o
Posts: 95
Joined: Mon Jan 29, 2018 11:19 am

Re: Loop problem

Post by yaro2o » Tue Feb 13, 2018 3:32 pm

So I understand that if I do as in the picture, the code from the setup will only be done when some window pops up in one of the recordings
You do not have the required permissions to view the files attached to this post.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Loop problem

Post by odklizec » Tue Feb 13, 2018 3:42 pm

Yes and no ;) Popupwatchers started in TestCase1 will catch popups in other test cases too. If you don't want the popupwatcher to act in other test cases, then you need to stop it in Teardown section of TestCase1. If you want a global popupwatcher (for all tests cases, regardless the first test case is started or not), then I would suggest to add the code module to Setup section of Test Suite.
Pavel Kudrys
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

yaro2o
Posts: 95
Joined: Mon Jan 29, 2018 11:19 am

Re: Loop problem

Post by yaro2o » Tue Feb 13, 2018 3:56 pm

Another question is the possibility to do all the projects in a specific order? We have 1000 prints in 8 programs, which are generated from individual dialogs when selecting individual options, how to choose a soundboard best? Can be set so that the tests will start automatically at a given time?

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Loop problem

Post by odklizec » Wed Feb 14, 2018 8:25 am

Hi,

I'm not sure I understand your last question? To run tests in a specific order, you should simply order them in a test suite. Or you can use command line parameters to run individual tests in a specific order.

In case you want to start tests at specific time, you can either use a windows scheduler, which is rather primitive solution, but easy to setup. Or you can use something called Continuous Integration (Jenkins, Bamboo, etc...), which is somewhat more complicated to setup, but which offers much more advanced tools and and wide range of settings for build and test process. I'm personally using Jenkins and it works very nice. I'm using one master server and 4 "slave" virtual machines, where my tests are running either at specific time or after someone builds a new version of AUT. Jenkins is then informed about new build and automatically starts the test. You can read more about Ranorex and Jenkins integration here:
https://www.ranorex.com/blog/integratin ... n-process/
Hope this helps?
Pavel Kudrys
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