Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DO UNTIL
#1
Solved: 10 Years, 9 Months, 1 Week ago
I have two actions. 1 logs me into a site as s specific user with specific roles (users stored in a dat table). The other navigates to a webpage within the site and checks to see if a menu option exists.

I want to login as a user if the menu option exist continue forward and finish the test . If not - log out as the first user and start with second user in datatable from the first action.

Any ideas?
Reply
#2
Solved: 10 Years, 9 Months, 1 Week ago
You can try like this: Create a master action and in that create two actions (one for first user- say A and another for second user - say B)
login as the first user (Master action).
Use a IF statement to check the menu option (IF NO)
Then Call Action A and continue forward
Else
Log out and call Action B

Hope it helps!
Reply
#3
Solved: 10 Years, 9 Months, 1 Week ago
Thanks Niranjan. That is very close to what I want but not quite. Here is what I have done. Action 1 logs me in with a user from the datatable. Action 2 uses an if to check the menu option and if not it logs me off then starts me at the beginning again like I want. The only thing now is telling it to advance forward in the data table. I am not quite sure how to do that. What happens now is it will run in a loop using the same user over and over. :-) Here's my code for Action 2. The main row is the one with the arrow. Is there a way I can set the first action to look at the next user in the data table or pass a parameter like I am trying to do there?


Code:
CheckMenuOption = Browser("Main Menu").Page("Main Menu").WebElement("Reporting").Check (CheckPoint("Reporting"))
If CheckMenuOption THEN
Browser("Main Menu").Page("Main Menu").WebElement("Reporting").Click
ELSE
Browser("Main Menu").Page("Main Menu").Link("@Home").Click
Browser("Main Menu").Page("Staff").Link("Logoff").Click
Browser("Main Menu").Page("Login").Link("Log in Using Desktop Username/").Click
-->>> RunAction "Masq until Menu Option displays", i = datatable.SetNextRow
END IF
Browser("Main Menu").Page("Main Menu").WebElement("Category Total Report").Click
Reply
#4
Solved: 10 Years, 9 Months, 1 Week ago
Actually - I solved this. I used the Global Data Sheet. Therefore the entire script runs from it and there was no need to pass a parmeter back and forth.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)