Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
seanog1983
Posts : 1
Join date : 2013-09-12

Selecting list of names on web page Empty Selecting list of names on web page

Thu Sep 12, 2013 12:54 pm
Hi

I am using Selenium with Firefox to create a Test Case which logs onto a web page and selects a list of Customers. 

Each customer when clicked on displays a list of users. Currently i am selecting each customer and displaying the list of users. The list is quiet long and so the test case for this has alot of same info just been listed line after line. 

Is there a way i can just select the first Customer and then use a loop to display the rest of the customers?
avatar
ccox
Master
Master
Posts : 205
Join date : 2012-01-06
Age : 38
Location : Denver, CO

Selecting list of names on web page Empty Re: Selecting list of names on web page

Fri Sep 13, 2013 5:17 am
Yes, you will either first need to download a user-extensions.js file with flow control or install the IDE flow control add in. This will give you the while and endWhile functions. If you specifically need to click on a user's name, create an array and click each user from the array.  Otherwise if you just need to go through all the users in the dropdown, then you can select by the index in which your loop is using.

store |0 | i
while ${i}<numOfUsers
select | id=dropdownName | index=${i}
Do whatever actions/assertions you need to
store | javascript{storedVars.i++}
endWhile
Back to top
Permissions in this forum:
You cannot reply to topics in this forum