aksanoop
12 years agoOccasional Contributor
Urgent-Not able to test through script runner in LoadUI
Hi Members,
I am working on a very urgent requirement. I want to do Load testing through LoadUI using Script Runner.
For my understanding i am using the below script saved as Test.groovy on my desktop.
******************************************************************************
@Grab(group='org.apache.httpcomponents', module='httpclient', version='4.1.1')
import org.apache.http.client.methods.HttpPost
import org.apache.http.message.BasicNameValuePair
import org.apache.http.impl.client.DefaultHttpClient
import org.apache.http.client.entity.UrlEncodedFormEntity
import org.apache.http.protocol.HTTP
post = new HttpPost("http://search.yahoo.com/search")
parameters = new ArrayList()
parameters.add(new BasicNameValuePair("p", "loadui"))
sendentity = new UrlEncodedFormEntity(parameters, HTTP.UTF_8)
post.setEntity(sendentity)
client = new DefaultHttpClient()
response = client.execute(post)
return ["responseBody":response.entity.content.text]
*************************************************************************
I browsed this script and provided the Fixed Rate Load to the Script Runner. I am catching the output in the Output Table.
When running the all requests are failing. The Output table gives me this error
java.lang.NullPointerException:Cannot set property "binding" on null object
Please help me in rectifying this issue. My work has stuck due to this reason.
Thanks in advance.
With regards,
Anoop.
I am working on a very urgent requirement. I want to do Load testing through LoadUI using Script Runner.
For my understanding i am using the below script saved as Test.groovy on my desktop.
******************************************************************************
@Grab(group='org.apache.httpcomponents', module='httpclient', version='4.1.1')
import org.apache.http.client.methods.HttpPost
import org.apache.http.message.BasicNameValuePair
import org.apache.http.impl.client.DefaultHttpClient
import org.apache.http.client.entity.UrlEncodedFormEntity
import org.apache.http.protocol.HTTP
post = new HttpPost("http://search.yahoo.com/search")
parameters = new ArrayList()
parameters.add(new BasicNameValuePair("p", "loadui"))
sendentity = new UrlEncodedFormEntity(parameters, HTTP.UTF_8)
post.setEntity(sendentity)
client = new DefaultHttpClient()
response = client.execute(post)
return ["responseBody":response.entity.content.text]
*************************************************************************
I browsed this script and provided the Fixed Rate Load to the Script Runner. I am catching the output in the Output Table.
When running the all requests are failing. The Output table gives me this error
java.lang.NullPointerException:Cannot set property "binding" on null object
Please help me in rectifying this issue. My work has stuck due to this reason.
Thanks in advance.
With regards,
Anoop.
