avax.script.ScriptException: Sourced file: eval stream : Typed variable declaration : Method Invocation httpClient.execute : at Line: 20 : in file: eval stream : httpClient .execute ( httpPost )
Called from method: write : at Line: 54 : in file: eval stream : write ( queryString ) Target exception: java.net.ConnectException: Connection timed out: connect in eval stream at line number 20
Can anyone please suggest me why this is causing the error and should do any modification in the script developed or any imports missing?
Looking into Connection timed out
message your code works more of less fine, it just fails to establish connection with the target server, it is hard to say anything without seeing it (blind shot: are you running your test via corporate proxy? If yes, your code won't respect JMeter proxy settings, you will need to perform a separate configuration)
In the meantime a couple of recommendations:
Tick Cache compiled script if available
box
Groovy is a much better scripting choice than Beanshell as it is capable of compiling scripts into bytecode while Beanshell interpreter evaluates it each time it calls so Groovy will perform be much faster (assuming the same code). Besides Groovy has better Java support and provides some extra features on top. See Groovy is the New Black article for more details.