Skip Navigation LinksHome Page > Forums > Rapise Forums > Rapise Issues & Questions > Check If Signed In Before...
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?
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
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?
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:
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.
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?