How to insert a condition to skip a recording module

Ask general questions here.
akhil.pokala
Posts: 22
Joined: Fri Jun 04, 2021 4:53 pm

How to insert a condition to skip a recording module

Post by akhil.pokala » Mon Jul 05, 2021 8:26 am

Hi ,

I have a use case where in first i will login to the application and then next is to validate some features.

Here there is a possibility that my previous test case due to some failure it might not signed out of my application . So when a new test case triggers it fails because directly home page is opened and it is waiting to identify a element on the login page .

Here i need to input a condition to validate first if already a home page is opened , then i need to skip the login recording module .

How to do it ? Please guide . Got stuck due to this .

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

Re: How to insert a condition to skip a recording module

Post by odklizec » Tue Jul 06, 2021 10:26 am

Hi,

There is no simple "single click" solution, to skip recording module, However, it may be possible to achieve what you want with using conditional Smart Folder. Please follow the solution in this post:
run-recording-module-based-on-get-value ... tml#p51628
Basically, you need to enclose the module you want to run conditionally in a smart folder, with enabled condition. And of course, before that smart folder, there must be a code module (or recording), which tests the UI and sets the conditional parameter (e.g. a global parameter set at Test Suite level). Then this parameter must be "binded" to the smart folder with condition. 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

Fergal
Certified Professional
Certified Professional
Posts: 455
Joined: Tue Feb 18, 2014 2:14 pm
Location: Co Louth, Ireland
Contact:

Re: How to insert a condition to skip a recording module

Post by Fergal » Thu Jul 08, 2021 5:32 pm

If you have a module that logs out of the application, you could include that module in the teardown of the first test. That way, even if the first test fails, it will still log out of the app, allowing the next test to run as it should.