cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic contentText

SOLVED
Highlighted
New Member

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Staff

Re: Dynamic contentText

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.

 

Best,
Justin Kim

View solution in original post

3 REPLIES 3
Highlighted
Staff

Re: Dynamic contentText

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.

 

Best,
Justin Kim

View solution in original post

Highlighted
Contributor

Re: Dynamic contentText

I am not sure what the error is that you are getting.  Are you assigning your value to a temporary project variable or a persistent project variable.  They behave differently between multiple runs of the same test. 

 

It may help to explain what the result of your efforts hava been so far.  If you are trying to select specific data from your Excel file you may need to use code with the DDT driver instead of simply looping through it in a keyword test...

 

https://support.smartbear.com/testcomplete/docs/testing-with/advanced/working-with-external-data-sou...

 

All about reading Excel data...

 

https://support.smartbear.com/testcomplete/docs/testing-with/advanced/working-with-external-data-sou...

 

There is also a required driver...

 

https://www.microsoft.com/en-US/download/details.aspx?id=13255 

 

Best of luck!

Highlighted
Community Manager

Re: Dynamic contentText

Thanks everyone for the suggestions!

Hi @nidlees , were you able to solve this? Please share the progress with us.


Sonya Mihaljova
Community and Education Specialist

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!

Challenge Status

Changing options from outside of TestComplete

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!

Comparing content of HTML table with Excel file data

Participate!

Compare HTML table with Excel file and correct data in the file

Participate!
Top Kudoed Authors