Hi to everyone!
First of all, I'm using Ranorex 7.0.1 with .NET Runtime Version 4.0.30319.34209 on Microsoft Windows 7 32 bits.
I was wondering if someone can help me with the original question in the post: stopping running recording module and continue with next one.
In my case, is not viable to use the trick of a smart folder, because my recording module is inside "Setup" section of the test case. Basically I do a sort of things at the beginning of every test case (
Setup) like open the application under test and make a login. But in every test case I CLOSE the application ONLY if something goes wrong during the test (that's because the application remains in a unuseful state). So the next test case must execute the recording module inside its Setup section ONLY if the application under test is not already opened.
My thought is running the recording module based on a condition. Converting it to a User Code Module is a really bad idea due to the ammount of objects that the module use and the comfort of the "actions" structure of the recording module.
I've tried to create a User Code Method (inside a User Code Collection) that is called as the first action of the recording module with this code:
[UserCodeMethod]
public static void EndModuleIfObjectExist(Ranorex.Core.Repository.RepoItemInfo iObject)
{
if (iObject.Exists(1000)) {
Ranorex.Core.Reporting.TestReport.EndTestModule();
}
}
When I include the User Code Method as the first action of the recording module, y set the application form object on iObject parameter. If the application is already opened, the Ranorex.Core.Reporting.TestReport.EndTestModule() instruction is executed, but then the recording module continue with the following actions inside it (which is not desired and lead to a error on the execution).
I don't know if I'm clear with the point, but basically I need on a recording module that the first action inside it define if the next actions must be executed or not and, if not, continue with the next recording module of the Setup section of the test case.
Thanks to everyone in advanced. Regards,
Simón