Highlighted
Trusted Contributor.
Trusted Contributor.
341 views

How to reuse the captured string in a Text box

Jump to solution

I am using TC Protocol, I have taken a value through "Evaluate JS Script"

In the Evaluate JS Script->code I have given the following,

var text = object.textContent;

var index = text.indexOf("Application Number ");

var randomText = text.substr(index+18);

TC.log("Captured String: "+randomText,Standard");

Captured String: 1212322145

But I want to know how to reuse this value(1212322145) in my last page of my flow.

 

 

 

JS
0 Likes
1 Solution

Accepted Solutions
Highlighted
Trusted Contributor.
Trusted Contributor.

Re: How to reuse the captured string in a Text box

Jump to solution

Thanks Kiran and Ravi, As you said, I directly used "RandomText" without Datapoint and it worked.

Can I carry over the same value to the next script as an input. Planning to use VTS

JS

View solution in original post

0 Likes
5 Replies
Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..

Re: How to reuse the captured string in a Text box

Jump to solution

You can use the variable "randomText" anywhere in your TruClient script.


Thank you,
NaveenKumar Namachivayam | www.QAInsights.com
Learn TruWeb - my Udemy Course "Performance Testing using TruWeb" | https://www.udemy.com/performance-testing-using-truweb/?couponCode=YOUTUBE
0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

Re: How to reuse the captured string in a Text box

Jump to solution

Yes, But don't know what syntax we need to use..i tried with TC.userDataPoint("JustNumber",randomText);

Its throwing error

JS
0 Likes
Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..

Re: How to reuse the captured string in a Text box

Jump to solution

As I said, you could use "randomText" anywhere in the steps, but make sure you select the Value type as JavaScript.


Thank you,
NaveenKumar Namachivayam | www.QAInsights.com
Learn TruWeb - my Udemy Course "Performance Testing using TruWeb" | https://www.udemy.com/performance-testing-using-truweb/?couponCode=YOUTUBE
Highlighted
Super Contributor.
Super Contributor.

Re: How to reuse the captured string in a Text box

Jump to solution

Hi,

The last page, select javascript as ID method and try the below one

evalXPath("//button[text()='" + ArgsContext.randomText + "']");  

 

Thanks,

V Ravi Kumar

 

Highlighted
Trusted Contributor.
Trusted Contributor.

Re: How to reuse the captured string in a Text box

Jump to solution

Thanks Kiran and Ravi, As you said, I directly used "RandomText" without Datapoint and it worked.

Can I carry over the same value to the next script as an input. Planning to use VTS

JS

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.