Forum Discussion

nidlees's avatar
nidlees
New Member
5 years ago
Solved

Dynamic contentText

Hi everyone!

 

Basically I have these 2 scenarios that I'm trying to run:

 

✤ Scenario 1:  I have to buy a product and select a specific credit card to complete the transaction.

✤ Scenario 2: I have to buy a product and select a credit card different from the first one to complete the transaction.

 

Note: these 2 credit cards already have been added to my account and the two options are available on my order checkout. 

 

So, what I'm trying to achieve is how can I make my test to dynamically select the correct credit card (without inserting an "if" validation for each Label). I'm also trying to achieve it from Keyword Tests.

 

Each Label follows the following contentText standard: **** **** **** #. The last 4 digits are the only thing that is different from each credit card. 

 

What I tried to do is included the whole "**** **** **** 8013" in a CSV and tried to set it into a project variable so I could replace the contentText for it, but it didn't work.

 

Any thoughts?

 

image.png

 

Regards,

Nidlees.

  • so it sounds like ultimately, you want a workflow where you can proceed with purchasing the item with various different credit card numbers. 

    I would suggest creating a csv file with a column header "credit card number" and then filling out the subsequent rows with  various different credit card numbers (i.e 1234 5678 9101 8013) 

    And then using the "make data loop" option, you can data drive your workflow by essentially parameterizing your credit card number value to be entries from your csv file. (https://support.smartbear.com/testcomplete/docs/keyword-testing/basic/data-driven-loops.html)

    In the end, what you have is the same workflow where you buy a product, but iterated multiple times over the entries in your csv file, so that you end up testing the purchasing of a product using multiple different credit card numbers.

     

3 Replies