cancel
Showing results for 
Search instead for 
Did you mean: 

One More Query on TestComplete

SOLVED
Highlighted
Occasional Contributor

One More Query on TestComplete

I have a script where i need to post few orders.

 

In My Script in need to enter Receipt number > i have enetered ReceiptNumber say=123 and run my script and if second time if im running script i need to have another receipt number (ie., anything other than 123).

 

My Query is: I need to Run script multiple times with different Receipt numbers.

in My Application Receipt Number is a text box and i need to enter different Receipt numbers while same script multiple times.

 

Please help me on how to Run script multiple times by automatically entering Diiferent Receipt Number without duplicates.

 

 

Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Leader

Re: One More Query on TestComplete

Hi,

By analyzing your problem, I think you can use saving values in:

Design variable - with this solution you can save the value between test iterations.
Doc: https://support.smartbear.com/testcomplete/docs/testing-with/variables/collections/project-and-proje...

 

Write in a variable in a script - if your test is called in one function, it will be easy to write the value in the variable.
Doc: https://stackoverflow.com/questions/19211768/saving-a-javascript-variable-for-later-usage

 

Use excel file - save data in excel and read specific cells according to the test iteration.
Doc: https://support.smartbear.com/testcomplete/docs/testing-with/advanced/working-with-external-data-sou...

 

Depending on which programming language you use, use random values to generate a variable value.
Example in JS: https://www.w3schools.com/jsref/jsref_random.asp.

View solution in original post

6 REPLIES 6
Highlighted
Community Leader

Re: One More Query on TestComplete

Hi,

By analyzing your problem, I think you can use saving values in:

Design variable - with this solution you can save the value between test iterations.
Doc: https://support.smartbear.com/testcomplete/docs/testing-with/variables/collections/project-and-proje...

 

Write in a variable in a script - if your test is called in one function, it will be easy to write the value in the variable.
Doc: https://stackoverflow.com/questions/19211768/saving-a-javascript-variable-for-later-usage

 

Use excel file - save data in excel and read specific cells according to the test iteration.
Doc: https://support.smartbear.com/testcomplete/docs/testing-with/advanced/working-with-external-data-sou...

 

Depending on which programming language you use, use random values to generate a variable value.
Example in JS: https://www.w3schools.com/jsref/jsref_random.asp.

View solution in original post

Highlighted
Community Leader

Re: One More Query on TestComplete

Does your problem is having a formatted random value ?

Un sourire et ça repart

Highlighted
Occasional Contributor

Re: One More Query on TestComplete

There was no format. for testing purpose ,I can enter any Receipt number .

 

if my Receipt number for first run is "123" and for second run my receipt number should not enter "123", it should go for another number say ex"456" etc. and for third run Receipt number should enter another number and so on...

Highlighted
Community Leader

Re: One More Query on TestComplete

In javascript, if you a not limited by size, enter the value of Win32API.GetTickCount() will give you an unique value at every call.

And with @Wamboo reply you'll have all elements to achieve your objective.

Un sourire et ça repart

Highlighted
Community Hero

Re: One More Query on TestComplete

Highlighted
Community Manager

Re: One More Query on TestComplete

Thank you Community. A lot of useful information in this discussion.

 

@thoshima which of the suggestions you used? Please make the best answer as a Solution!


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors