Am 06.04.21 um 16:27 schrieb Krister Nilsson:
> -----Ursprungligt meddelande-----
> Från: Felix Schumacher <felix.schumac...@internetallee.de>
> Skickat: den 6 april 2021 16:16
> Till: user@jmeter.apache.org
> Ämne: Re: SV: Response assertion seems to not always set 
> JMeterThread.last_sample_ok correctly
>
>
>
>
>
> Am 06.04.21 um 16:09 schrieb Krister Nilsson:
>
>> Hi Felix!
>> Thanks for the reply!
>
>> Here is a short clip from the log file.
>> 2021-04-06 15:55:48,063 INFO o.a.j.v.J.JSR223 Listener: ap38:
>> JMeterThread.last_sample_oktrue
>> 2021-04-06 15:55:48,064 INFO o.a.j.p.j.s.J.Print to file - esb-ap38:
>> fileName = ./overvakning_props_sit_tel/props-esb-ap38fuse-soapui.xml
>> 2021-04-06 15:55:48,065 ERROR o.a.j.p.j.s.JSR223Sampler: Problem in
>> JSR223 script Print to file - esb-ap38, message:
>> javax.script.ScriptException: java.io.FileNotFoundException:
>> .\overvakning_props_sit_tel\props-esb-ap38fuse-soapui.xml (The system
>> cannot find the path specified)
>> javax.script.ScriptException: java.io.FileNotFoundException:
>> .\overvakning_props_sit_tel\props-esb-ap38fuse-soapui.xml (The system
>> cannot find the path specified)
>> As you can see I am using slashes (forward) but since I am running Jmeter on 
>> a Windows server I assume it is Windows who translates the error message 
>> using backslashes.
>> And as I mentioned this worked on Thursday and no changes except JSR223 
>> Postprocessors to JSR223 Listeners have been made and they are not involved 
>> in printing to the file either, it is a JS223Sampler handling that part.
>
>
> Is the file name correct? Have you checked, that you would find the file, 
> when using it char for char? Is the file located somewhere, where you, but 
> not the user running JMeter has access?
>
>
>
> Krister: I have copied the folder name from the log file and listed "ls -l 
> <folder name>" and it works. On Thursday, when it worked, the file didn't 
> have to exist, Jmeter created the file provided the folder was created 
> before. Anyhow, I tried by generating an empty file with the same name to see 
> if, for some reason, the file needed to exist before, but it does not help. 
> Neither if I use backslashes in the JSR223Sampler helps.
>
>
Has Windows a `ls -l ...` command?

But more importantly, how are you using the file (creating, writing) in
the JSR223 script. Can you show an example?


>
>
> How are you using the file in the script? Maybe, you have called JMeter from 
> a different location the last time it worked? JMeter has some magic built in 
> to try to load files from different locations (the one, relative to where the 
> loaded script is and relative to JMETER_HOME).
>
>
>
> Krister: I am running Jmeter from the same place as on Thursday (and many 
> times before that). The jmx-file is located in the same folder as where the 
> overvakning_props_sit_tel folder is located.
>
> I do feel there is some magic going on here, probably the black variant… ??

I doubt, that it is black or some other kind of magic, even if it
sometimes feels like it.

Felix

>
>
>
> Felix
>
>
>
>> BR
>> /Krister
>> -----Ursprungligt meddelande-----
>> Från: Felix Schumacher 
>> <felix.schumac...@internetallee.de<mailto:felix.schumac...@internetallee.de>>
>> Skickat: den 6 april 2021 15:58
>> Till: user@jmeter.apache.org<mailto:user@jmeter.apache.org>
>> Ämne: Re: SV: Response assertion seems to not always set
>> JMeterThread.last_sample_ok correctly
>> Am 06.04.21 um 12:16 schrieb Krister Nilsson:
>>> Ok! Thanks!
>>> The mental fatigue was most likely at my end since I thought I knew what 
>>> you were saying without really listening. Changing the JSR223 
>>> Postprocessors to JSR223 Listeners seems to have solved my problem. Sorry 
>>> for not getting back to you sooner and show my appreciation, but an Easter 
>>> weekend came in-between... ??
>>> However, the story did not end entirely happy. I ran in to a problem after 
>>> having fixed the above one, a problem I run into occasionally without 
>>> really understanding.
>>> 2021-04-06 11:31:04,610 ERROR o.a.j.p.j.s.JSR223Sampler: Problem in
>>> JSR223 script Print to file - esb-intjanandetiden, message:
>>> javax.script.ScriptException: java.io.FileNotFoundException:
>>> .\overvakning_props_sit_ica\props-esb-intjanandetiden-soapui.xml (The
>>> system cannot find the path specified)
>>> javax.script.ScriptException: java.io.FileNotFoundException:
>>> .\overvakning_props_sit_ica\props-esb-intjanandetiden-soapui.xml (The
>>> system cannot find the path specified)
>> Have you tried to use slashes instead of backslashes? I.e.
>> ./overakning_props_sit_ica/props-esb...
>> Java will gratefully convert paths separated with / to the correct separator 
>> depending on the used platform. The backslash (\) might be interpreted as an 
>> escape character, which could confuse some elements.
>> Felix
>>> Everything looks ok, the exact same path worked Thursday and no changes 
>>> except the above one has been made since then. I cannot guarantee that no 
>>> patches to the server has been made since then, but I do not believe so 
>>> since no restart has occurred.
>>> Grateful if you have a time to have a glance on it!
>>> /Krister
>>> -----Ursprungligt meddelande-----
>>> Från: 
>>> glin...@live.com<mailto:glin...@live.com<mailto:glin...@live.com%3cmailto:glin...@live.com>>
>>> <glin...@live.com<mailto:glin...@live.com<mailto:glin...@live.com%3cmailto:glin...@live.com>>>
>>> Skickat: den 1 april 2021 17:40
>>> Till:
>>> jmeter-u...@jakarta.apache.org<mailto:jmeter-u...@jakarta.apache.org<mailto:jmeter-u...@jakarta.apache.org%3cmailto:jmeter-u...@jakarta.apache.org>>
>>> Ämne: Re: SV: Response assertion seems to not always set
>>> JMeterThread.last_sample_ok correctly I might be suffering from a
>>> form of a mental fatigue but I pretty much sure I posted the link to
>>> the JMeter test elements  execution order
>>> <https://jmeter.apache.org/usermanual/test_plan.html#executionorder>
>>> Response assertion is executed *AFTER* the JSR223 PostProcessor so if the 
>>> assertion fails the request - you will get false positive result.
>>> You need to change it to the  JSR223 Assertion
>>> <https://www.blazemeter.com/blog/scripting-jmeter-assertions-in-groov
>>> y
>>> -a-tutorial>
>>> (but make sure to place it *below* the Response Assertion as they're
>>> executed upside down) or switch to the  JSR223 Listener
>>> <https://jmeter.apache.org/usermanual/component_reference.html#JSR223
>>> _
>>> Listener>
>>> .
>>> --
>>> Sent from: http://www.jmeter-archive.org/JMeter-User-f512775.html
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail:
>>> user-unsubscr...@jmeter.apache.org<mailto:user-unsubscr...@jmeter.apa<mailto:user-unsubscr...@jmeter.apache.org%3cmailto:user-unsubscr...@jmeter.apa>
>>> c<mailto:user-unsubscr...@jmeter.apache.org%3cmailto:user-unsubscribe
>>> @jmeter.apac>
>>> he.org>
>>> For additional commands, e-mail:
>>> user-h...@jmeter.apache.org<mailto:user-h...@jmeter.apache.org<mailto<mailto:user-h...@jmeter.apache.org%3cmailto:user-h...@jmeter.apache.org%3cmailto>
>>> :user-h...@jmeter.apache.org%3cmailto:user-h...@jmeter.apache.org>>
>
>

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to