Check If Signed In Before Test Start

Wednesday, March 7, 2018 6:28:37 PM

Hello,

    I am trying to write a test that involves the actions of signing in and out of a web application. However, I also work manually in this web app as well so I need to sign in manually as well, which can mess up the test results if I forget to sign out when I'm done. To save myself worry, I'm trying to add an if-statement in my script that checks if the user profile button that appears when one is logged in is on the screen. If it is, then the script will continue, but if not, then the script will perform the necessary log-in actions. I seem to be having trouble generating the if-statement in the RVL language though. What would an if-statement in RVL look like that verifies if a user is logged by checking if the user profile icon, or maybe something else, is visible in the window?

4 Replies
Wednesday, March 7, 2018 8:25:49 PM
Avatar
re: Pinto18 on Wednesday, March 7, 2018 6:28:37 PM

Never mind. I got it working. My setup was to include the if-statement  with the action of getting whether the profile button was enabled. My RVL looks similar to this:

 

     If       Action             profile_button      GetEnabled

               Condition                                           output1 isTrue

             #If actions

 

Now my problem is that the test seems to fail whenever GetEnabled returns False (no one is signed in). Seeing as I included this step as a precaution, I wan't expecting this behavior. Is there a way for Rapise not to consider the test as FAILED if the profile button is not enabled?

Wednesday, March 7, 2018 9:17:14 PM
Avatar
re: Pinto18 on Wednesday, March 7, 2018

The issue most likely that the 'GetEnabled' property is checking if the item is enabled, but visible. In this case it is not actually visible (most likely). So instead you way want to use:

profile_buttonDoEnsureVisible


Regards

Adam

Thursday, March 8, 2018 4:09:06 PM
Avatar
re: inflectra.adam on Wednesday, March 7, 2018

Adam,

    Please disregard my previous reply. Both the method I mentioned previously and the method you recommended generate an expected result. Both methods work just fine when a user is already logged in, but if a user is not logged in, then the test has an overall status of fail. Is this expected? I would imagine an if-statement inside a test should not affect the overall result of the test. The if-statement should only affect the test by verifying whether a particular condition is true.

 

Nick 

Tuesday, March 20, 2018 2:00:55 PM
Avatar
re: inflectra.adam on Wednesday, March 7, 2018

I am still experiencing an issue with trying to get this feature to work. When I have an if-statement like this:

    |      Action     |   sign-in-button  |   DoEnsureVisible        |                  
    |  Condition |                                      |   output1 IsNotNull    | 

 

The test fails if I am already signed-in. The sign-in button should not be visible in this case because we skip the sign-in page if we are already signed-in. The test should not fail if the sign-in button is not visible. If the output of 'DoEnsureVisible' is Null, then the result should only be that the test does not perform the log-in actions. Is there something I am doing wrong with my if-statement inside my RVL script?

              
 

Statistics
  • Started: Wednesday, March 7, 2018 6:28:37 PM
  • Last Reply: Tuesday, March 20, 2018 2:00:55 PM
  • Replies: 4
  • Views: 160