Topic
  • 1 reply
  • Latest Post - ‏2013-01-03T06:15:26Z by RajniJain
Naveesh
Naveesh
16 Posts

Pinned topic Important: Need your help to remove trailing-spaces of variable in HATS mac

‏2013-01-03T04:19:38Z |
Hi,

I need solution for problem I have been facing now.

Since, I have been working in web services project in HATS and issue is - in one of HATS macro, there are three prompts for input variables, let say name, id and remarks i.e. in_remark macro variable.
As per requirement, I'm extracting remarks field value from HOST screen and storing it in variable called tmp_remarks and comparing it with input value of in_remark macro variable.

1. Prompt for input variable remarks and save it to macro variable called in_remark
2. And type of macro variable in_remarks is String and is not user-defined type.
3. tmp_remarks variable type is Str where Str is user-defined Type under java.lang.String
4. tmp_remarks variable is extracted from Host screen through 'Update Variable' action through visual macro editor as: $HMLPSUtil.getString(894,34)$
5. then, we perform '$tmp_remarks.trim()$' in 'Update Variable' action given in visual macro editor.
6. In Evaluate (IF) action, we are using condition like: $tmp_remarks.equals($in_remarks$)$

Now, when user inputs ' test' value in in_remarks macro variable and value extracted from Host screen in tmp_remarks variable is 'test' then condition i.e. $tmp_remarks.equals($in_remarks$)$ is getting fail because
of trailing-spaces in in_remarks variable. Is there any way to do trim() function for in_remarks variable to remove trailing spaces?
And, we tried changing type of in_remarks macro variable as uder_defined variable Str under java.lang.String but in vain.

Can you please assist to fix this issue? Your assistance will be highly appreciated.
Note: The condition $tmp_remarks.equals($in_remarks$)$ is working fine in case IF user does not send trailing-spaces in in_ramarks macro variable.

Thanks in advance.

Regards,
-NAVEESH
Updated on 2013-01-03T06:15:26Z at 2013-01-03T06:15:26Z by RajniJain
  • RajniJain
    RajniJain
    12 Posts

    Re: Important: Need your help to remove trailing-spaces of variable in HATS mac

    ‏2013-01-03T06:15:26Z  
    Hi Naveesh,

    Just want to confirm , where end user is entering "test" without space or " test".
    If user is trying to enter "test" and prompt is taking as " test" , it means while recording recording prompt cursor position is not correct.
    while setting the prompt , you have provided some space.

    Regards,
    Rajni