JMeter GWT Escape Character Exception - gwt

I'm trying a test in JMeter for requests that include a regular expression in its body. Trying to re-run the test, I get the below exception:
//EX[,,["com.google.gwt.user.client.rpc.IncompatibaleRemoteServiceException", "Unexpected escape character after backslash
The request body under the recording controller looks something like:
^([\w\-\.\'+]+)#(([([0-9]{1,3}\.){3}[0-9]{1,3}]))
While the request in "View Results Tree" is like:
^([\w-.\']+)#(([([0-9]{1,3}.){3}[0-9]{1,3}]))
Can anyone help please?

Related

Google Cloud Storage list objects with name containing "%" return 403 error

I am getting my objects by calling
https://<bucket>.storage.googleapis.com/?prefix=folder%2F<object name>%2F&delimiter=/&max-keys=1000
I have tried with other special characters like !, #, #, $, ^, &, *, (, ), etc.
For the other special characters I just encode them in the , and I get the response just fine.
For example, with object "!#" under folder, the url is:
https://<bucket>.storage.googleapis.com/?prefix=folder%2F%21%22%2F&delimiter=/&max-keys=1000
However, when I try with object names with "%" and encode the percent sign to "%25", I get the following error:
<?xml version='1.0' encoding='UTF-8'?><Error><Code>InvalidSecurity</Code> <Message>The provided security credentials are not valid.</Message><Details>Request was not signed or contained a malformed signature</Details></Error>
What could be causing this issue ?
Edit
So I have tried double encoding the percent sign such that '%' character becomes "%2525" in the request. However, in the response, the prefix is strangely "%25". After testing with more cases, it turns out a request is successful only when "%25" is followed by 2 characters both within the range of '0' and 'f', however, the response prefix would be wrong. For example, "%25ab" in the request would result in "%ab" in the response prefix.
I believe this is a service side bug: see https://issuetracker.google.com/issues/117932947
I think a workaround is to encode the percent twice. But this may start failing in the future when the bug is fixed.
The error message you're seeing is because you don't have enough permissions to access to your object.
If you're using an authentication method (APIkey, bearer, etc) make sure that they have the needed Roles for GCS.
However, I can see that you're calling the objects just as a GET request. Try to Make your objects public and try it again with that encoding (%25). It should work.
Hope this is helpful!

JMeter response assertion validation against xml response failed

XML response :
<silent><send-sss destination="*1234">TEST mId=dev oId=XXXXXXXXX</send-sms></silent>
JMeter response assertion:
Pattern matching Rule: contains
Pattern to test: silent
Failed Reason:
org.apache.oro.text.MalformedCachePatternException: Invalid expression: *1234
?+* follows nothing in expression
Could anyone please let me know what should be there is an assertion that it should fail. I tried using few patterns but it didn't work for me.
In Response Assertion to find part of a string you need to choose Substring in Pattern Matching rules
Contains, Matches: Perl5-style regular expressions
Equals, Substring: plain text, case-sensitive
If you choose Contains (meaning regular expression) , you need to escape *, then use
\*1234
For XML response types it makes more sense to go for XPath Assertion which allows checking response using arbitrary XPath queries.
If you want to test presence of <silent> tag only the relevant XPath query would be as simple as //silent.
With regards to Response Assertion, its Contains mode is PatternMatcher.contains() so it requires a regular expression, not a simple String so you should be using something like .*silent.* as the pattern.
See How to Use JMeter Assertions in Three Easy Steps article for more information on defining custom pass/fail criteria using JMeter Assertions.

Akka-Http how to deal with special characters in the URL (like %)

In my akka http app I receive a lot of errors like this one:
Illegal request-target: Invalid input 'v', expected HEXDIG (line 1, column 72)
It happens when I simply add a '%' character to the URL. In this case akka exoects a hex value.
Is it possible to somehow 'clean up' or encode/ignore such characters?
For users of an API who got this error message and don't know how to solve it:
I had the same problem, with a URL that queries something from a third party database, one part of the URL was simply not correct and that caused this error message.
I think this error message is misleading since it sounds like you should encode the URL differently which is not the case at all, just check if the structure of the URL is correct.

Backslash in endpoint

I need to consume an endpoint from SoapUI which contains a backslash like:
mydomain/myservice/{id_resource}
and the assignment:
id_resource = numbers\numbers
The problem here is that when I executed the request, the consumed url is mydomain/myservice/numbers%40%5Cnumbers, and if I check the option of disabling the URL-encoding, it ignores the backslash () between the numbers of the id_resource, going to an url like mydomain/myservice/numbersnumbers.
I've tried to scape the character with another backslash, like java or other languages, but it doesn´t work.
It works fine if I consume the service with postman, so it is not a problem of the logic consumed.
So, is it possible to consume an url containing a backslash from SoapUI?
There is an option to disable URL encoding for the selected parameter which would assist with this.
https://www.soapui.org/rest-testing/reference/method-window.html

How to deal with Facebook thread IDs that contain forward slashes

When requesting a list of a users threads through https://graph.facebook.com/me/threads some of the threads are coming through with a forward slash character in the ID.
For example:
"id": "t_Cb0/atPMZaJw/cUuNtLW8B",
However trying to request this thread through https://graph.facebook.com/t_Cb0/atPMZaJw/cUuNtLW8B obviously fails due to the forward slashes
The error specifically returned is:
"message": "Unknown path components: /atPMZaJw/cUuNtLW8B"
I tried escaping the forward slashes with %2F but returns the same error, how can these be dealt with?
There are bug reports already about this, to
workaround: https://graph.facebook.com/?ids=atPMZaJw%2FcUuNtLW8B should work (i.e pass the escaped string in the 'id' or 'ids' parameter instead of as part of the request path)