Hello,
I am very new to Ranorex and Test automization. I am currently using the Trail version to check if it works as we expect or not.
The problem i am facing might be very small. But I want to test the login to an application and use all the available usernames.
There are in total 9 username with the same password. So what I want to do is to try the first username/password combo, if its already in use then try the second one and so on...
If the first username is not currently in use then log in to the application and run further steps.
How should I proceed with this? Do I need to create a usercode? I am not good with programming but I can give it a try.
Kiran Zaheer
Login with multiple usernames
Re: Login with multiple usernames
Hi,
Basic login of multiple users, is relative simple task and could be done via data-driven approach (described here).
However, your problem is somewhat more complicated and I think it may require some coding. The question is, how do you decide which user name is already taken? Could you please describe the whole process a bit more detailed? Also, we may need a Ranorex snapshot (NOT screenshot) of the login dialog. Because you are a new forum member, you will have to use a google drive or similar service, to post the snapshot here (as a link). Thanks.
Basic login of multiple users, is relative simple task and could be done via data-driven approach (described here).
However, your problem is somewhat more complicated and I think it may require some coding. The question is, how do you decide which user name is already taken? Could you please describe the whole process a bit more detailed? Also, we may need a Ranorex snapshot (NOT screenshot) of the login dialog. Because you are a new forum member, you will have to use a google drive or similar service, to post the snapshot here (as a link). Thanks.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: Login with multiple usernames
Actually the application allows 9 users to login at a time. So there are username1....username9 with the same password. What I want to achieve is, at the time of running the test, the first user name is typed in and if its already in use by some other user... then the second and so on. The test shouldn't fail until it has tried all usernames and all of them are not available.
Re: Login with multiple usernames
Hi,
I understand the test flow, but I don't know how to tell a user is already logged in? This something you need to somehow validate, either via recording or code. Unfortunately, I'm unable to suggest something more specific without seeing the AUT or, at very least, a Ranorex snapshot of the login dialog/dialog determining a user is already logged in.
I understand the test flow, but I don't know how to tell a user is already logged in? This something you need to somehow validate, either via recording or code. Unfortunately, I'm unable to suggest something more specific without seeing the AUT or, at very least, a Ranorex snapshot of the login dialog/dialog determining a user is already logged in.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: Login with multiple usernames
Yes, thats the only way. But I think I don't need to validate if the user is already logged in.
In case the username is available, there is no error dialog. So the testcase proceeds normally.
If the username is already in use, there is an error message. Is this possible to somehow decide to try next username based on this error dialog?
Also I have no idea where should my user code go? Should I create a method? or it should go to my LoginAUT.usercode.cs? and how to invoke this usercode?
Login Dialog:
https://drive.google.com/file/d/1DBhsst ... sp=sharing
Error Message: (Pardon, its in German)
https://drive.google.com/file/d/1XuSqSO ... sp=sharing
In case the username is available, there is no error dialog. So the testcase proceeds normally.
If the username is already in use, there is an error message. Is this possible to somehow decide to try next username based on this error dialog?
Also I have no idea where should my user code go? Should I create a method? or it should go to my LoginAUT.usercode.cs? and how to invoke this usercode?
Login Dialog:
https://drive.google.com/file/d/1DBhsst ... sp=sharing
Error Message: (Pardon, its in German)
https://drive.google.com/file/d/1XuSqSO ... sp=sharing
Re: Login with multiple usernames
Still looking for help!!
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Login with multiple usernames
Hi KiranZa,
To achieve your intention, you could create a structure like the one shown below The TestSuite itself contains a parameter called "loggedIn" which is set to false by default The TestCase has a condition that checks if the parameter "loggedIn" is false The modules "EnterCredentials" and "clickLogin" should be self-descriptive.
The CodeModule "isLoggedIn" basically checks if a user is alread logged in and sets the parameter "loggedIn" to true Once the parameter is set to true, the condition will be false and the Test Case is not executed anymore.
Of course, this sample is very basic and just checks the status strip for a logged in user, but it should give you an idea about the structure you can use for conditional execution.
Please let me know if you have any further questions.
Regards,
Markus (S)
To achieve your intention, you could create a structure like the one shown below The TestSuite itself contains a parameter called "loggedIn" which is set to false by default The TestCase has a condition that checks if the parameter "loggedIn" is false The modules "EnterCredentials" and "clickLogin" should be self-descriptive.
The CodeModule "isLoggedIn" basically checks if a user is alread logged in and sets the parameter "loggedIn" to true Once the parameter is set to true, the condition will be false and the Test Case is not executed anymore.
Of course, this sample is very basic and just checks the status strip for a logged in user, but it should give you an idea about the structure you can use for conditional execution.
Please let me know if you have any further questions.
Regards,
Markus (S)
You do not have the required permissions to view the files attached to this post.