Highlighted
Established Member..
Established Member..
1481 views

How to use parameters in xpath in tru client script

Jump to solution

I have a xpath to click on a object which is having a specfic text (for eg: //a[text()="Kumar Com1"]    )

I made "Kumar Com1" is coming from a parameter file in earlier step. (for eg: TC.getParam("AccontName")   )

Now I want to replace my xpath with parameter name. like //a[text()=TC.getParam("AccontName") ]    

here is the issue. it is not recognizing the object. some thing I am missing to give in xpath properly

Please advise

Kumar

0 Likes
1 Solution

Accepted Solutions
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: How to use parameters in xpath in tru client script

Jump to solution

Hi,

Please check this webinar around the 35th minute.. You also have a link to some sample scripts on that YouTube page.

Good luck,

Shlomi

 

View solution in original post

2 Replies
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: How to use parameters in xpath in tru client script

Jump to solution

Hi,

Please check this webinar around the 35th minute.. You also have a link to some sample scripts on that YouTube page.

Good luck,

Shlomi

 

View solution in original post

Highlighted
Established Member..
Established Member..

Re: How to use parameters in xpath in tru client script

Jump to solution

Hi Shlomi,

I tried with the options mentioned in video but not working.

Here is my best trail:

evalXPath("//a[text()=\"DexHub: Consultation Prep  - \"+ArgsContext.TC.getParam(\"AccountName\")]");

again, I am missing something here. pls advise.

 

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.