This is a migrated thread and some comments may be shown as answers.

Place product in cart using datadriven file

1 Answer 4 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sharon
Top achievements
Rank 1
Sharon asked on 30 Apr 2014, 05:20 PM
Position:
  Senior Level QA Tester,   Telerik Experience Level:  Beginner,
   Programming experience: Minimum



I would like to 

1) Sign into my
eCommerce account 

2) Click into the
Search field

3) Locate one
product using a product ID number

4) Add that product
to the shopping cart

5) Process the
shopping cart 

4) Return to the
home page

5) then loop back
to step 2   using a datadriven text
file with a list of 50 products



So far, I have been
successful in 

-recording these
steps by manually entering a product ID number into the Search field 

-creating and
attaching the datadriven text file



My difficulty is
accessing one product ID at a time from the Datadriven text file to put into
the shopping car. Currently, the shopping cart does not process until all of
the items are placed into the cart.     Where should the Datadriven
text file be placed within the Test?  What other steps are required to do
this?   (See step #16 on the attached file)



Thank you for your
assistance!

1 Answer, 1 is accepted

Sort by
0
Daniel Djambov
Telerik team
answered on 05 May 2014, 09:45 AM
Hi Sharon,

Here is how I think you test should look like:
1. First several steps responsible for logging in with credentials
2. now call another TestAsStep (lets call it SearchDB) that contains the following steps:
Click into search field, locate product based on ID, add to shopping cart, process the shopping cart, return to home page where Search field is located
Then you should databind this SearchDB test with the excel file and set data binding to the step search field and all steps which contain data text from file while processing the order
3. Logout steps of the test
The above scenario will do the following: start the test, login, then perform 50 times search and process the orders with different data, when finished will logout. This however create 50 orders for the same logged user, so the shopping cart items will grow from 0 to 50.

I'm not sure what your use case will be and if this is what you want. If you want for the user to have only 1 new item 50 times, then you data bind your main test and it will perform 50 times login, search for 1 specific item, logout.

Here is some documentation about databinding: http://docs.telerik.com/teststudio/user-guide/data-driven-testing.aspx - please have a look and if you still have specific questions, please let us know.

Regards,
Daniel Djambov
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Sharon
Top achievements
Rank 1
Answers by
Daniel Djambov
Telerik team
Share this question
or