Ajax Click And Script replay failed (629 Views)
Reply
Occasional Advisor
Chunn Kuen
Posts: 9
Registered: ‎04-25-2010
Message 1 of 8 (629 Views)

Ajax Click And Script replay failed

[ Edited ]

Dear Experts,

 

I having a problem with web_text_link in my script. During my recording it is something like this :

 

 web_text_link("To Do List",
  "Snapshot=t27.inf",
  DESCRIPTION,
  "Ordinal=1",
  "FrameName=leftMenuFrame",
  "BrowserOrdinal=2", 
  "Text=To Do List",
  ACTION,
  "UserAction=Click",
  LAST);

 

 

So then when i replay, it tell me cannot find such text link (To Do List) but found something like (To&nbspDo&nbspList                )

 

Even in the page view are the same with the replay, the spacing between word are become "&nbsp". It looks like the CLICK action is not really happening that it doesn't go to next page

 

I seriously run out of clue, can any expert here help?

 

Thanks,

Alvin.

HP Expert
Editus
Posts: 650
Registered: ‎04-06-2011
Message 2 of 8 (577 Views)

Re: Ajax Click And Script replay failed

Hello
This is a common problem on Ajax C&S, replace the failing step with alternative navigation (doing right click on the problematic function) or simply regenerate the script on UR or HTML mode.

hope this helps

regads
Occasional Advisor
Chunn Kuen
Posts: 9
Registered: ‎04-25-2010
Message 3 of 8 (566 Views)

Re: Ajax Click And Script replay failed

Hi There,

 

Thanks for the reply.

 

I do try that method, but yet it seems like still fail.

It just doenst perform the Click action.

 

Any other work around?

 

Thanks,

Alvin.

HP Expert
vmanolova
Posts: 536
Registered: ‎05-24-2012
Message 4 of 8 (559 Views)

Re: Ajax Click And Script replay failed

Hi Alvin,

 

You can try two options:
1. In the function web_text_link() replace the "Text=To Do List" with the correct equivalent the application is expecting for example  "Text=To Do List"

2. You can correlate the link and use the correlated value in  web_text_link step.

If the value should be converted from one encoding to another you can use the following function: web_convert_param. Here is an example if you need to convert from HTML to plain format:

web_convert_param("htmllink", "SourceEncoding=HTML","TargetEncoding=PLAIN", LAST );

You can review the function reference for more details about using web_convert_param.

 

Kind regards,

HP Support
If you haven’t tried it yet, come and join us in our entitled forums at Support Customer Forums
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution and give Kudos to the author for their assistance.
Occasional Advisor
Chunn Kuen
Posts: 9
Registered: ‎04-25-2010
Message 5 of 8 (552 Views)

Re: Ajax Click And Script replay failed

Hi

 

The 1st option is confirm out, i tried before and its still give me the same error.

 

Trying on the 2nd option but i couldnt do the correlation as i didnt manage to grab any where for its 1st occurance.

 

I am still trying now.

 

Thanks,

Alvin.

HP Expert
vmanolova
Posts: 536
Registered: ‎05-24-2012
Message 6 of 8 (539 Views)

Re: Ajax Click And Script replay failed

Hi Alvin,

 

Is there a specific reason you need to  working with Ajax Click and Script?

You can also try using  Ajax TruClient protocol. Will this be an option for you?

 

Kind regards,

HP Support
If you haven’t tried it yet, come and join us in our entitled forums at Support Customer Forums
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution and give Kudos to the author for their assistance.
Occasional Advisor
Chunn Kuen
Posts: 9
Registered: ‎04-25-2010
Message 7 of 8 (526 Views)

Re: Ajax Click And Script replay failed

Hi vmanolova,

 

Reason is being is the appliaction do some setting in the compability view, while i realize firefox do not have such option. And because of that the page of the application doesn't appear fully. So i go for ajax Click and Script.

 

Thanks,

Alvn.

Occasional Advisor
PS_LR
Posts: 10
Registered: ‎10-15-2013
Message 8 of 8 (510 Views)

Re: Ajax Click And Script replay failed

I have experienced the same but I used http/html protocal only.

 

In my point of view, the issue is not related to the protocols you used. Instead, the Ajax call request body will convert the request from plain text format to URL format. This is the reason why "To Do List" becomes "To&nbspDo&nbspList" as spaces will not be allowed in the URL format.

 

Please check the LR function web_convert_param, and hope this will help.

 

web_convert_param("To Do List",
  "SourceString=return_string", //return_string will return the string after conversion
  "SourceEncoding=PLAIN",
  "TargetEncoding=URL",
  LAST);

 

intweb_convert_param( const char *ParamName, [char *SourceString] char *SourceEncoding, char *TargetEncoding, LAST );

 

 

 
Part
Description
ParamName
The name of a parameter. The converted string will be saved in this parameter. If SourceString is not used, it initially contains the text to convert. Note that this is not a name–value pair. Pass only the name of the parameter.
SourceString
A literal string to convert. "SourceString=your text"
SourceEncoding
The encoding type of the source data: HTML or plain text, in the format: "SourceEncoding=HTML
or
"SourceEncoding=PLAIN"
TargetEncoding
The target data format: URL or plain text, in the format "TargetEncoding=URL"
or
"TargetEncoding=PLAIN"
LAST
A marker indicating the end of the argument list.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.