While running recorded simulation in Gatling, I got file not found error - scala

now I'm trying to conduct load test with gatling.
I have been trying create gatling's simulation script via gatling recorder and
it was going well.
but, when I executed that, I encountered file not found error below although there are files
(in this case /step1/0006_request.json is exist)
request_6: Failed to build request: Resource /step1/0006_request.json not found
there are many json files and that error occurred some of specific post requests.
every requests which is failed are composed following setting.
using request header 'headers_6' below
using RawFileBody method
(even if this is obvious thing because content-type is 'application/json')
I already have been using 12 hour over and I have to finish my task in a timely manner.
I'm so sorry about that I can't share my application which is target of this issue.
if anyone have any idea or kindly want to more detail please ask me.
val headers_6 = Map(
"Content-Type" -> "application/json",
"Origin" -> "applicationServerURL")
.exec(http("request_6")
.post("requestUrl")
.headers(headers_6)
.body(RawFileBody("/step1/0006_request.json"))
.resources(http("request_7")
additionally, I checked json files which were created by gatling recorder on 'resource' directory, them contains only one char 'X'.
this means Gatling recorder doesn't capture request json file's content?
env:
Gatling version gatling 3.5.1
Used Browser: FireFox

I just solved this issue.
this issue was caused by very simple fact.
firstly, I encountered error message below
request_6: Failed to build request: Resource /step1/0006_request.json not found
and I have to check the file paths although this script was auto created by gatling recorder(do not trust gatling tool).
The auto created file path was absolute path and start with ‘/’. And the script started to work once I remove the ‘/’.
I referred other post on stack overflow, and it was written that file path must be written with absolute path if you are using gatling version 3 or later version.
I hope my reply can be informative to someone who may be having same issue as me.
Using 'relative path'.
//As is
.exec(http("request_6")
.post("requestUrl")
.headers(headers_6)
.body(RawFileBody("/step1/0006_request.json"))
.resources(http("request_7")
//To be
.exec(http("request_6")
.post("requestUrl")
.headers(headers_6)
.body(RawFileBody("step1/0006_request.json"))
.resources(http("request_7")

Related

embedded-file on PDF generation fails with 403

i try to embedd some files into the pdf using Apache FOP.
So far so good. But the attachements are only available using basic auth.
When i run my code i get an exception
Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: https://sample.atlassian.net/rest/api/3/attachment/content/10015
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1997)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224)
at java.base/java.net.URL.openStream(URL.java:1161)
at org.apache.fop.apps.io.ResourceResolverFactory$NormalResourceResolver.getResource(ResourceResolverFactory.java:224)
at org.apache.fop.apps.io.ResourceResolverFactory$TempAwareResourceResolver.getResource(ResourceResolverFactory.java:152)
at org.apache.fop.apps.io.ResourceResolverFactory$DefaultResourceResolver.getResource(ResourceResolverFactory.java:121)
at org.apache.fop.apps.io.InternalResourceResolver.getResource(InternalResourceResolver.java:92)
at org.apache.fop.render.pdf.PDFRenderingUtil.addEmbeddedFile(PDFRenderingUtil.java:668)
at org.apache.fop.render.pdf.PDFDocumentHandler.handleExtensionObject(PDFDocumentHandler.java:329)
The embedding code looks like
#foreach($attachment in $issue.attachments)
<pdf:embedded-file filename="${attachment.id}-$xmlutils.escape($attachment.fileName)" src="url(${attachment.url})"
description="Attached to [$xmlutils.escape($issue.key)]"/>
#end
is there anything i could do, i could download the files and provide them as lokal files if that is possible? or could i provide an custom resource resolver, that also does authentication?
Help is appreciated
Regards
Oliver

JMeter variable Encoding is not correct

I'm using Jmeter 5.3 on Windows 10. I'm facing with the following problem:
I set the HTTP request to content encoding: UTF-8. In the response I saw it as I wanted.
"name": "Győr, autóbusz-állomás",
I tried to extract the response with JSON Extractor, but my assertion is failed and in the debug sampler the extracted name look like:
origin.name=Gy�r, aut�busz-�llom�s
How could I extract the variable in UTF-8 to use it in my assertion?
Thank you in advice,
I had the same problem. It was resolved with setting in HTTP Request "UTF-8" value on field "Content encoding".
Without it in my request was "???" symbols.
I cannot reproduce your issue:
Double check file.encoding System property value using the Debug Sampler, you should have UTF-8
If you don't - try launching JMeter as:
jmeter -Dfile.encoding=UTF-8
if it helps - add file.encoding=UTF-8 line to system.properties file (lives in "bin" folder of your JMeter installation, JMeter restart will be required to pick the property up.
More information:
Guide to Character Encoding
Apache JMeter Properties Customization Guide
Try to resolve with:
Go to jmeter.properties file
Add property: sampleresult.default.encoding=UTF-8
Restart jmeter & enjoy
Good luck!

SOAP API Automating testing with ROBOTFRAMEWORK

Good day,
I am trying to use robot framework to test a soap based api. I tried using the RobotFramework-Soap library first. I tried a sample case and it works but as soon as I put in my api link it does not work. Im not sure if it is because my api link contains an api.
N.B. due to confidentiality I am unable to post the actual api link. But it is in the format shown below.
*** Settings ***
Library SoapLibrary
Library OperatingSystem
*** Test Cases ***
Example
Create Soap Client http://000.000.000.000:8000/SomeService?wsdl
${response} Call SOAP Method With XML ${CURDIR}/request.xml
${text} Get Data From XML By Tag ${response} AddResult
Log To Console ${text}
Save XML To File ${response} ${CURDIR} response_test
When I run the above test. It fails with following error:
ConnectionError: HTTPConnectionPool(host='xxx_cert', port=8000): Max retries exceeded with url: /SomeService?xsd=xsd0 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
I even tried using the suds library as well. and when i do a simple test as follows:
***Test Cases***
Example
Create Soap Client http://000.000.000.000:8000/SomeService?wsdl
I get the following error: URLError: urlopen error [Errno 11001] getaddrinfo failed
I did some searching and I found that it could be related to the port. But Im not sure how to resolve this issue.
Any assistance would be greatly appreciated.
Thanks,
Lee
The solution was to edit the local host file to cater for the web service. That seemed to solve all the problems.

Crowdin error when I tried to upload translations

I've an issue (I'm still blocked), I've created my configuration file like :
project_identifier: test
api_key: KeepTheAPIkeySecret
base_url: https://api.crowdin.com
base_path: /path/to/your/project
files:
-
source: /locale/en/LC_MESSAGES/messages.po
translation: /locale/%two_letters_code%/LC_MESSAGES/%original_file_name%
See : https://github.com/crowdin/crowdin-cli
However, I received an error message when I execute my command line to upload translation in Crowdin :
error: Seems Crowdin server API URL is not valid.
Please check the `base_url` parameter in the configuration file.
I don't know why it's not working!Thanks for any help !
Crowdin sent me another JAR,
The last one was not good for windows path.

Io Language : Exception: Object does not respond to 'URL'

Today I'm exercising an Io example of "seven language of seven weeks."
Example code:
futureResult := URL with("http://google.com/") #fetch
writeln("Do something immediately while fetch goes on in background...")
writeln("This will block until the result is available.")
writeln("fetched ", futureResult size, " bytes")
Running with exception:
Io$ io future.io
Exception: Object does not respond to 'URL'
---------
Object URL future.io 1
CLI doFile Z_CLI.io 140
CLI run IoState_runCLI() 1
Directly run URL in io with following error:
~$ io
Io 20110905
Io> URL
Exception: Object does not respond to 'URL'
---------
Object URL Command Line 1
Io>
My environment is:
Ubuntu 14.04
Followed post , I have done following:
$ sudo apt-get install libevent-dev
$ ./build.sh
$ ./build.sh install
URL error is fixed.
But following error thrown:
Do something immediately while fetch goes on in background... This
will block until the result is available. fetched Exception: Error
does not respond to 'size' --------- Error size
future.io 6 Error size future.io 6 CLI
doFile Z_CLI.io 140 CLI run
IoState_runCLI() 1
Post help to install Io
For anyone else like me who is years later running into this issue (or any other "Exception: Object does not respond to X" issue) while following along with Bruce Tate's Seven Languages in Seven Weeks, the solution may be this:
There are some Objects/libraries which seem like they would be included in core Io based on the documentation, but are not. You must install them as addons with eerie.
To do so, follow the instructions here. Basically, you have to look for the correct addon under the IoLanguage group on Github, and install it.
This particular issue with the URL Object is further complicated by a couple of problems I will expound upon below.
There is no addon for URL, instead the functionality for URL is covered by an addon called Socket (located here.)
To get eerie to install Socket, you first need to install something called libevent. I did this by going to the libevent website, downloading the most recent stable version, extracting the files to a directory, and then following the instructions on how to build libevent with CMake on the libevent github page.
The Socket object seems to not have support for https. The number of websites that still use http is dwindling. Google, the website used in the example in Seven Languages in Seven Weeks, moved away from http years and years ago. The first website I was able to come across that still uses http is a Chinese news website, but you can find other examples by googling around for "Websites still using http."
After accounting for all of these issues, I finally got my version of the code to work.
url := URL with("http://xinhuanet.com/")
// Had to find a website still using http, https is unsupported by Socket.
futureResult := url #fetch
// Moved this call to own line for personal clarity
writeln("Do something immediately while fetching.")
writeln("The below statement will block until the result is available.")
writeln("fetched ", futureResult size, " bytes") // Blocks until complete
And my output looks like:
Do something immediately while fetching.
The below statement will block until the result is available.
fetched 99992 bytes