Highlighted
Super Contributor.. Super Contributor..
Super Contributor..
1285 views

Trying to select Radio Button in Truclient

The web page in question has several rows, and in order to select the right row you click on the radio button.  Each button has unique value, from the page source (<label for="forLoanReq"></label><input type="radio" name="appPkgAndLoanReqDetails" value="552453&gt;620749&gt;FS&gt;CMP&gt;false" ) the two 6 digit numbers are in parm dat file.

Below is a screen shot of the step in true client.  I have pasted the xpath value.

//input[@type="radio" and @value="LR.getParam("PackageID")>LR.getParam("LoanREQID")>FS>CMP>false]";

I am still a rookie on truclient, so any assistance is greatly appreciated.

 

TruClient Capture.PNG

0 Likes
11 Replies
Highlighted
Outstanding Contributor.
Outstanding Contributor.

Re: Trying to select Radio Button in Truclient

 Can you use the Related Objects functionality to help?

0 Likes
Highlighted
Super Contributor.. Super Contributor..
Super Contributor..

Re: Trying to select Radio Button in Truclient

It will allow me to select a different row once.  How do modify to select a different unique row every time. 

I tried the script with the related object and it wouldn't complete.  Saying the target object not found.

0 Likes
Highlighted
Super Contributor.
Super Contributor.

Re: Trying to select Radio Button in Truclient

Hi,

Suggest you using JavaScript as the ID method, suppose you have two parameter tables respectively for attribute Name and Value, in this way you can call the parameters using code such as "ArgsContext.TC.getParam("ParamName")"

1. change you ID method to Javascript,

 

111.png

 

 

 

 

 

 

2. write below code in the JS editor:

var paramName=ArgsContext.TC.getParam("ParamName");
var ParamValue=ArgsContext.TC.getParam("ParamValue");

var str = '//input[@type=\"radio\" and @name=\"' + paramName + '\" and @value=\"' + ParamValue + '\"]';
evalXPath(str);

 

Thanks,

Penn

0 Likes
Highlighted
Super Contributor.. Super Contributor..
Super Contributor..

Re: Trying to select Radio Button in Truclient

Penn,

Thank you for your assistance.  I am still getting Object not found.  I have pasted the original data below and the JS created per your suggestion.  I am not sure how to handle the GT signs and the data at the end.  Please review and provide and suggestions or corrections.  Again your assistance is greatly appreciated.

Original Input data

//input[@type="radio" and @value="551212>621212>FS>CMP>false"]

JS data

var PackageID=ArgsContext.TC.getParam("PackageID");
var LoanREQID=ArgsContext.TC.getParam("LoanREQID");

var str = '//input[@type=\"radio\" and @value=\"' + LoanREQID + '\">\"' + PackageID + '\">FS>CMP>false\"\"]';
evalXPath(str);

0 Likes
Highlighted
Super Contributor.
Super Contributor.

Re: Trying to select Radio Button in Truclient

Hi Idebner,

It seems you didn't combine your str correctly, try to copy&paste this one as your str:

    var str = '//input[@type=\"radio\" and @value=\"' + LoanREQID + '>' + PackageID + '>FS>CMP>false\"]';

BTW, please make sure your two parameter table contains the correct value of the PackageID and LoanREQID.

 

if my solution works for you, please mark it as final solution 🙂

 

0 Likes
Highlighted
Super Contributor.. Super Contributor..
Super Contributor..

Re: Trying to select Radio Button in Truclient

Penn,

Thanks for correcting my JS str.  I am still getting a target not found issue.  Why is it looking at the name field instead of the JS code?

 

 

 

 

 

 

 

Object not found.PNG

0 Likes
Highlighted
Super Contributor.
Super Contributor.

Re: Trying to select Radio Button in Truclient

Hi,

1. which version of LR you're using? which browser you run the script on?

2. AFAIK, you can always change the name field's value, it is used as a dispaly usage.

3. before you execute this step, make sure the web site is already navigated to this page.

4. because I can't access your script, I'm not sure if your combined JS string is a unique XPath, you'd better also combine the "Name" attribute of your radio button. 

5. can you upload some screen snapshots that including (a. two tables of your parameters. b. the piece of HTML code of your multiple radio buttons. c. the JS code in your TruClient's JS editor)

0 Likes
Highlighted
Super Contributor.. Super Contributor..
Super Contributor..

Re: Trying to select Radio Button in Truclient

Hello Penn,

I am using version 12.02. Browser FireFox.

I did insert a validate step to make sure I am on the correct page.

I have upload the other information in a png file.   Your assistance is very much appreciated.

The highlighted code with red letters is the radio button part I need to correlate.

Larry

 

0 Likes
Highlighted
Super Contributor.. Super Contributor..
Super Contributor..

Re: Trying to select Radio Button in Truclient

Penn,

 

Is there anything you need to solve my issue?

 

Larry

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Trying to select Radio Button in Truclient

Hi Larry,

Did you manage to overcome this challenge? 

Regards,

Shlomi

 

0 Likes
Highlighted
Super Contributor.. Super Contributor..
Super Contributor..

Re: Trying to select Radio Button in Truclient

Shlomi,

Sadly no.  I was unable to get this particular TruClient script to work and the client had to take the results for what I have completed so far on other scripts.  I hope I can get this resolved before the next release.

Thanks,

Larry

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.