Valid JSONPath is throwing EOF in RestAssured JsonPath - rest-assured-jsonpath

The JSONPath that is normally working is not working when used in rest-assured-JSONPath
tenants=jpath.getList("$..aa[?(#.name=='tid')].value");
is throwing
Script1.groovy: 1: expecting EOF, found '[' # line 1, column 59.
untime-response'.$..aa[?(#.name=
$..aa[?(#.name=='tid')].value is working when I validated using https://jsonpath.com/
what am i doing incorrectly? please help. thanks in advance.

As mentioned in the docs, the jsonpath library in rest-assured uses Groovy GPath syntax and NOT Jayway's jsonpath syntax which is what you're trying. If you post a sample json you're working with and what you're trying to extract, I can try to help you come up with the correct expression.

Related

Kusto extract text between string

Am trying to use regex to extract a string between a set of strings. But Kusto complains about the regex expression as invalid.
Am trying to replicate the expression from this link in my kusto query.
traces
| where ....
| project extract_all(#"(?<=This is)(.*)(?=sentence)", message)
Kusto would complain this error..
Relop semantic error: 'extractall' has the following semantic error: SEM0420: Regex pattern is ill-formed: (?<=This is)(.*)(?=sentence).
If issue persists, please open a support ticket. Request id: 01b819be-2e11-4983-9312-30f946c07afb
Could someone please help me fix the syntax of the above regex for kusto?
as the error message suggests, the regular expression you're specifying as the argument to the extract_all() method is invalid.
from the documentation: https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/re2
The regular expression syntax supported by Kusto is that of the re2 library.
If you were to provide a sample input and the matching expected output, it'd be easier to provide you with a functional and efficient solution.

Element locator with prefix 'xpath("//android.widget.edittext[#resourse-id' is not supported

I want to input username.
I have tried to find element as below using UIatomator but it throwing error.
Input Text xpath("//android.widget.EditText[#resourse-id='name']") test
I have attached screenshot for reference please help..please suggest
You are using the wrong syntax for xpath. The syntax is:
Input Text xpath=//android.widget.EditText[#resource-id='name']
The format is described in the Selenium2Library documentation, under the section "Locating or Specifying Elements"
Try like this:
xpath = "//*[#resource-id='name']/android.widget.EditText"
I believe it solves your problem.

JMSSecurityExtraBundle nested AND/OR expressions

I have this #PreAuthorize annotation:
#PreAuthorize("(hasRole('PERM_EDIT_ALL_CAMPAIGNS') or (has_role('PERM_EDIT_OWN_CAMPAIGNS') and isCampaignAccountManager(#id))) and (hasRole('PERM_EDIT_ALL_PUBLISHERS') or (has_role('PERM_EDIT_OWN_PUBLISHERS') and isAffiliateAccountManager(#paramFetcher.get('affiliate_id'))))")
I get the following error:
Expected primary expression, but got \u0022has_role\u0022 of type T_NONE at position
40 (0-based)
So the error looks like to appear after the bracket beginning here:
(has_role('PERM_EDIT_OWN_CAMPAIGNS') and isCampaignAccountManager(#id)))
Is there any way to add brackets in and/or expressions?
Thanks in advance
OMG!! sorry, I just realized after I wrote the question. I was using 'has_role' instead 'hasRole' :(

Is it possible to disable Command Substitution in Bash?

Is it possible to disable Command Substitution in Bash?
I want to pass a string containing several backticks characters as command-line argument to a program, without trailing backslashs or quoting the string.
Thank you.
I assume there is a misconception which grounds your question. Quoting is most likely the solution to your situation. But maybe you haven't found the right way of quoting yet or similar.
If your dangerous string shall be verbatim (without quoting or escaping) in the source code, you can put it in a separate file and read it from there:
dangerous_string=$(cat dangerous_string_file.txt)
If it shall be passed without interpretation to a command, use the double quotes to prevent interpretation:
my_command "$dangerous_string"
If you have to pass it to a command which needs to receive a quoted version of your string because it is known to carelessly pass the string without using sth like the double quotes to prevent interpretation, you can always use printf to get a quoted version:
quoted_dangerous_string=$(printf "%q" "$dangerous_string")
careless_command "$quoted_dangerous_string"
If all these options do not help in your situation, please explain in more detail where your problem lies.

Can arguments be passed to List variable in ROBOT framework

My problem is:
I am trying something like this
${${variable}} Create List
${variable} --this will be passed as an argument.
I get the following error when I do it:-
No keyword with name '${${variable}}' found
To make a list use #{list}, but not ${variable}. To parse ${variable} to list, use something like this: #{list} ${first_variable} {seconn_variable}.
More info you can get here:
http://robotframework.googlecode.com/hg/doc/userguide/RobotFrameworkUserGuide.html?r=2.7.4#list-variables
Hope this would help you!

Resources