InjectJS activity - Type Error: _clientFunc is not a function

Hi,
I am using InjectJsScript activity to inject some javascript code that will do some actions on a web page.
My javascript is working fine. But at the end it is throwing an error
“Type Error: _clientFunc is not a function”. It seems the problem is not in the javascript code.
Can anyone help me?

Capture

2 Likes

can you post the java script?

@skini76
SetTextInInput(“First Name”, “RaviSangam”);
SetTextInInput(“Last Name”, “Sekhar”);
SetTextInInput(“Role in Company”, “Asst”);
SetTextInInput(“Company Name”, “QSI”);
SetTextInInput(“Email”, “ashkjahkjhs@gmail.com”);
SetTextInInput(“Address”, “shdjshfjds”);
SetTextInInput(“Phone Number”, “5656454545”);

function SetTextInInput(labelText, inputText) {
var aTags = document.getElementsByTagName(“label”);

for (var i = 0; i < aTags.length; i++) {
	if (aTags[i].textContent ==  labelText){
		aTags[i].parentNode.getElementsByTagName("input")[0].value = inputText;
		break;
	}
}

};

Can you change the script & try

function(SetTextInInput,inputText) {
var aTags = document.getElementsByTagName(“label”);

for (var i = 0; i < aTags.length; i++) {
	if (aTags[i].textContent ==  labelText){
		aTags[i].parentNode.getElementsByTagName("input")[0].value = inputText;
		break;
	}
}
};

@skini76
The script which you suggested is not working. I mean it is not setting strings in textboxes.
I am doing this as apart of Cahllenge#1
http://rpachallenge.com/

1 Like

Sorry, some error in the script, you can refer the below link

Actually, my script is working fine and setting the data… But at the end it is throwing that error.

can you send me that js file @ravisangam

Set “ContunueOnError” to true and try

you can try this option too

image

It is suppressing the error :slight_smile: and working fine…

Actually, i want to do the same challenge in all possible ways…

@ravisangam can u share workflow and javascript for the above?

Challenge1.zip (73.8 KB)

1 Like

@ravisangam I am getting error while running ur workflow.

Yeah… That is the problem… But it is setting the values to the text boxes.
As suggested by @skini76, i set “ContunueOnError” to true.I know, it just suppresses the error but not solves it.

@ravisangam ur workflow is not setting any values to text boxes

Make sure that the js file using is “varinput.js” and its content is

SetTextInInput(“First Name”, “RaviSangam”);
SetTextInInput(“Last Name”, “Sekhar”);
SetTextInInput(“Role in Company”, “Asst”);
SetTextInInput(“Company Name”, “QSI”);
SetTextInInput(“Email”, “ashkjahkjhs@gmail.com”);
SetTextInInput(“Address”, “shdjshfjds”);
SetTextInInput(“Phone Number”, “5656454545”);

function SetTextInInput(labelText, inputText) {
var aTags = document.getElementsByTagName(“label”);

for (var i = 0; i < aTags.length; i++) {
if (aTags[i].textContent == labelText){
aTags[i].parentNode.getElementsByTagName(“input”)[0].value = inputText;
break;
}
}
};

1 Like

@ravisangam it is working fine i had problem in chrome, i changed to IE. I removed true in continueOnerror property also.

Yeah. But it is failing in chrome :frowning: