Run a recovery from an unknown failure

ALM v17

UFT 24.2

I am running test scripts through ALM test lab. There is current over 100 scenarios (workflows) that run one after the other. There are not dependent on each other - only the contents inside the actual scenario.

The application that I am testing on, is chrome (portal to SAP).

This is extremely slow and I have attempted to put in waits for this and that and if not exist etc etc but it still wants to fails in the most unpredictable places.

It could be a drop down that doesn't contain value(s) and should / object appearing more than once on the page (even through it has many properties to define it and I can't see any other object on page that matches the properties)

If I have catered for an error condition, it goes through the close out of the portal / chrome.

But if the error is an unknown, it tends to leave the page open and fails the test and then starts the next test in the group which then fails because there is more that one chrome open. And then everything fails from there on.

Anyway...

What I want to do is

make sure all instances of chrome are closed including any extra tabs

If <test fails in ALM> Then  

    If Browser("Home").Exist(1) Then
        Browser("Home").Close
   End If
   If Browser("SAP NetWeaver Portal").Exist(1) Then
       Browser("SAP NetWeaver Portal").Close
   End If
   If Browser("Settings - Privacy and security").Exist(1) Then
       Browser("Settings - Privacy and security").Close
   End If
  If Window("Google Chrome").Exist(1) Then
       Window("Google Chrome").Close
  End If

End If

Can this be put in place?

How do I achieve this?

I have looked at the recovery scenario but that requires know error conditions - and appear like it needs to be attached to every action / scenario (lot of work)

Tags:

  • 0  

    Instead of putting it at the end which may likely be not achievable, you can check if it can be added to the beginning of the next test.

  • 0   in reply to   

    Thanks

    I realized that I didn't have

     If Window("Google Chrome").Exist(1) Then
           Window("Google Chrome").Close
      End If

    in the open chrome action - which is at the beginning. I had the rest.

    So I am giving that a go currently.

    Still curious - is there something that will go off to a cleanup / recovery script / action when it appears with a fail in ALM.

    Mostly, I do not get errors / fails when running direct from UFT, I only get the rubbish and suspect failure when I run through ALM.

    I was hoping that our recent upgrade to ALM 17 was going to resolve that - but alas - no.

  • Suggested Answer

    0   in reply to   

    Ideally if you select "Any error" for test run error trigger in the recovery scenario, you should be able to close browsers as you need.

    But as you pointed, an RS needs to be associated with actions so that may not be feasible.

    It has been a practice to do something like this as part of the cleanup/initialization at the first action in a test flow.