multiple combination flow
this keeps running in my mind for long years but got time to pendown today.
In a screen we have multiple combination to go with, to put it simple, say in webpage based on the user, different buttons like Login1/CLick1/SUbmit1 button for user1, Login2/CLick2/SUbmit2 button for user2 and so on....
Now based on the user i have to select the buttonx or clickx or submitx, using exists consumes lot of time. Any best solution if any one used please share the code or idea
Thanks in advance
Are you asking about how to test users that have different ROLES?
You can have some logic like below:
If you have more users then rather than using "if" condition, you can use Switch statement.
I think its good if you opt for regular expression to identify the objects rather than having conditional flow, just my thought. Try to have objects identified using regular expression.
Set oDescB1 = Description.Create()
oDescB1("micClass").value = "WebButton"
oDescB1("some property").value = "Log.*"
etc., or have in-line description of object.
Have you tired descriptive programming, Will make easier in your case
multiple combination flow
Sorry, will have to narrow down. For the same user in the account page, if he already has the account it will be displayed in dropdown, if he is new he need to create new account by clicking a link(new user), if he already has the account and not linked then he will have a differnt link to proceed.
I dont have any prior information on the account details, first i have to check if 1. account is displayed in dropdown, 2. then if i can link the accoutn else 3. create a new account.
If I go with exist for dropdown then if link for linking the account id displyed and else to create a new account, if its new user it will go for 2 if condition which will consume time...
your suggestions please
It seems to me that the best way is for YOU to control your script. This means write your script so that YOU determine which user you're using and keep that information in variables or in the DataTable, so that YOU can have the script interact with the correct objects that correspond to the user.
But maybe that's not the behavior you want, or maybe that's out of your control. If you really must create your script to NOT know which user is currently active so that the script must look at the screen and evaluate which objects exist (or which objects are enabled), then remember that it's true, using .Exist does consume a lot of time, but using .Exist(0) consumes no time. Of course, this only works if the page is fully loaded already; using .Exist(0) on a page that isn't finished loading could cause your test to fail when it shouldn't.
"The last 10% of any software project will take 90% of the budgeted time. The first 90% will take the other 90%"
Just to get an idea of how much time the script is consuming can you try and give the time its consuming.
How much time you have put in .Exist(?), this is a synchronization statement - it will wait till the application and test object is loaded and available for performing an operation.
As said above by BlakeWalker, its good for you to control your script execution by providing a particular user type and performing all required validations in subsequent steps.
If your drop down has got options and based on the available option if you got to proceed further, can you get the content of the drop-down and then based on the available content can you try executing a particular say case statement or if condition??
Just a thought and hope i understood your problem correctly, let me know your thoughts.
thanks everyone for your support...
From the information received, checking the page sync followed by exist(0) is the best solution. We have around 200 users to go with, since our project is at very first level and in transition phase with automation, will go the above suggested solution.
I'm with Blake on this, I would generally have 2 scenarios that I control, New User & Existing User. Quiet often I would link the 2 scenarios so they are self-serving:
Create a New User.
Log on with the newly created user.