Forum Discussion

dikshika114's avatar
dikshika114
Contributor
3 years ago

How can i Pass my Test Case after checking one element Which should not exists on the screen

There is one situation like :

I wanna add a check like:

1. if Object A doesn't exists or visible on screen than Test Case should be passed.

2. If Object A exists or visible on screen than Test Case should be failed.

 

Can you please tell me, how can i do that.

    • dikshika114's avatar
      dikshika114
      Contributor

      vinniew 

      Hi. I am using JavaScript not Keyword script.

      The code part is something like that: for my conditions but it's not working because it's returning error for "deleteLocationLink.Exists" because it delete location link doesn't exists. vinniew 

       

      if(equals(deleteLocationLink.Exists, false))
      {
      Log.Message("User did not have permissions to Delete this location.");
      }

      else
      {
      Log.Error("User don't have permissions to Delete this Location but he is able to do that.");
      }