Skip to main content
Astronaut
Mar 4, 2024 12:18 PM UTC
Solved

It it possible to buffer a random generated number in API request ?

Hi,

i found this topic… 

 

But this is not the solution for my problem.

My problem is following:

I create a random number with syntax {RND[8]} as value in my API request testcase.

So it works and the random number is generated.

 

But I need to buffer this random generated value for a later testcase.

When I create a Buffer for this testcase

And I start the request, then Tosca give me an error back.

My question is, how can I generate a random number and buffer this value in one step?

Or is there another solution to my problem?

 

I hope you can help me.

BR Franz

Ensign
Mar 4, 2024 7:09 PM UTC

Hi,

i found this topic… 

 

But this is not the solution for my problem.

My problem is following:

I create a random number with syntax {RND[8]} as value in my API request testcase.

So it works and the random number is generated.

 

But I need to buffer this random generated value for a later testcase.

When I create a Buffer for this testcase

And I start the request, then Tosca give me an error back.

My question is, how can I generate a random number and buffer this value in one step?

Or is there another solution to my problem?

 

I hope you can help me.

BR Franz

I’m not sure if it’s possible to achieve this in one step.

What I would do is use TBox Set Buffer to generate the random value first. Then use the buffer value in the API request step.

3 replies

Ensign
Mar 4, 2024 7:09 PM UTC

Hi,

i found this topic… 

 

But this is not the solution for my problem.

My problem is following:

I create a random number with syntax {RND[8]} as value in my API request testcase.

So it works and the random number is generated.

 

But I need to buffer this random generated value for a later testcase.

When I create a Buffer for this testcase

And I start the request, then Tosca give me an error back.

My question is, how can I generate a random number and buffer this value in one step?

Or is there another solution to my problem?

 

I hope you can help me.

BR Franz

I’m not sure if it’s possible to achieve this in one step.

What I would do is use TBox Set Buffer to generate the random value first. Then use the buffer value in the API request step.

FranzAuthor
Astronaut
Mar 5, 2024 10:18 AM UTC

Hi Brendon, thank you for your support. It works fine.

TBox Set Buffer…. 

Oh my God. I'm wondering why I didn't think of this solution 🤔

Ensign
Mar 5, 2024 7:02 PM UTC

Hi Brendon, thank you for your support. It works fine.

TBox Set Buffer…. 

Oh my God. I'm wondering why I didn't think of this solution 🤔

No problem! With a UI test you can certainly use the solution you were attempting, e.g. enter a dynamic value into a text box then immediately buffer it. But I’ve found I prefer the TBox Set Buffer solution anyway - I like to define any such dynamic values at the beginning of the test (under the Preconditions folder) since I find them easier to maintain and reuse that way.