Hi,
I want to call some method present in code module(.cs file) periodically...Reply with lines of code.
How to call method from code module periodically?
-
- Posts: 11
- Joined: Mon Jan 14, 2013 8:50 pm
Re: How to call method from code module periodically?
Not quite sure I understand your question...
Are you using the Ranorex IDE to develop your tests in code?
Are you using A Ranorex Test Suite and want to call code from a user module?
Are you using record/playback and want to add code from a user module?
By periodically, what do you mean? Randomly? At a specific interval of time? When you feel the need to call it?
Please elaborate...
Are you using the Ranorex IDE to develop your tests in code?
Are you using A Ranorex Test Suite and want to call code from a user module?
Are you using record/playback and want to add code from a user module?
By periodically, what do you mean? Randomly? At a specific interval of time? When you feel the need to call it?
Please elaborate...
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!
Ciege...
Ciege...
-
- Posts: 11
- Joined: Mon Jan 14, 2013 8:50 pm
Re: How to call method from code module periodically?
Yes..I want to call this method for some interval of time(eg. 1min interval) again and again i.e periodically..
Problem : I want to keep polling at status bar after login successful in our web application. In web application, for some reason exception is thrown and error icon comes at status bar and at this time I want to stop test case.I want to write some generic method in code module so that I can track error by calling this method periodically during live run test case.
Problem : I want to keep polling at status bar after login successful in our web application. In web application, for some reason exception is thrown and error icon comes at status bar and at this time I want to stop test case.I want to write some generic method in code module so that I can track error by calling this method periodically during live run test case.
Re: How to call method from code module periodically?
That's going to be a little tricky.. You will need to create a second, worker thread whose only purpose is to watch for this error. If the worker thread detects the error then it will need to trigger the main thread to cease testing.
Have a look here to help you get started...
http://www.ranorex.com/blog/handling-di ... up-windows
Have a look here to help you get started...
http://www.ranorex.com/blog/handling-di ... up-windows
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!
Ciege...
Ciege...
-
- Posts: 11
- Joined: Mon Jan 14, 2013 8:50 pm
Re: How to call method from code module periodically?
It worked but new problem occurred. To fail test case I had written Environment.Exit(-1) after error match found as written in your solution, test case stopped successfully but after this execution it was not showing ranorex report log at end which usually comes after every test case success or failure. Instead of Environment.Exit(-1), I had tried to throw RanorexException but same problem.