I'm trying to build a process in topdesk/freemaker that gets the expected arrival date from a visitor using the "get" https://obscured.topdesk.net/tas/api/visitors/${unid} in step 1.
In step 2 I'm to get the data stored in step 1 and check if the expected arrival is the same a today using the following:
${_responses.GetVisitorData.body.expectedArival}["dd MMMM yyyy"] == now?string["dd MMMM yyyy"]
But when I run it, it gives me the following error:
[2021-10-19T07:18:44.947659300Z] Error while processing FreeMarker template: The following has evaluated to null or missing:
==> _responses.GetVisitorData.body.verwachteaankomst [in template "action sequence" at line 1, column 3]
While step 1 does seem to be storing the data correctly:
[2021-10-19T07:18:44.947659300Z] Storing response data
[2021-10-19T07:18:44.947659300Z] Successfully finished step 'GetVisitorData'
I'm really lost as to why it evaluates to null.
Any help to point me in the right direction would be greatly appreciated.
According to the TOPdesk API documentation for visitor registration, the expected arrival date/time is part of a subset called visit:
image: GET visitor API result
So, if you want to retrieve the expectedArrival date you need to use:
${_responses.GetVisitorData.body.visit.expectedArival}
Since expectedArival only occurs in the subset and not in the main category, ${_responses.GetVisitorData.body.expectedArival} would evaluate to null, since it doesn't exist.
Related
I'm making a logging system with discord.py. For now, I'm trying to get the number of messages were deleted from a single audit log entry (since sometimes the audit logs updates an entry instead of creating a new one), so I tried with "entry.action.count". Here's my code
#client.command()
#commands.has_permissions(administrator=True)
async def deletecount(ctx):
async for entry in ctx.guild.audit_logs(limit=1, action=discord.AuditLogAction.message_delete):
print(entry.action.count)
But instead of printing the number of messages deleted, it just prints
<built-in method count of _EnumValue_AuditLogAction object at 0x000001FF9769C640>
From this screenshot, in this case the latest entry has 5 deleted messages. I'm trying to print out that "5". So how do I get the number of message deleted from the latest audit log entry? The documentation doesn't have further information on how to use the extra attribute for entry.action.
I should also add that I have asked someone about this, they suggested to try print(entry.action.count()), but I got
TypeError: tuple.count() takes exactly one argument (0 given)
What is the argument that should be given there? Thanks in advance.
It is possible, use the extra attribute and it will return a dict with the data you want (the docs don't give you a lot of information about it because the return value differs from the type of action):
async for entry in ctx.guild.audit_logs(limit=1, action=discord.AuditLogAction.message_bulk_delete):
count = entry.extra['count']
The return value of AuditLogEntry.extra varies depending on the type of event, the example above will only work with message_bulk_delete
PS: You were using the wrong action in the iterator, it should be AuditLogAction.message_bulk_delete not AuditLogAction.message_delete
References:
AuditLogEntry.extra
First time here so I'll try to be most readable possible. I have a test in a feature file which uses a datatable for sorting some data as seen below:
Current cucumber test example
Currently I am using scenario.test_steps.map(&:name) to get all the steps (this is necessary because of an integration to an application lifecycle software manager) in an array and this is what I get:
Cucumber steps got in the hooks file
My question is: is it possible to get the datatable information in the Before do |scenario| hook over the hooks file?
Thanks in advance to anyone who helps!
When iterating through scenario.test_steps, each test step has an associated Cucumber::Core::Ast::Step. This contains the step specific information such as the step name, data table, etc. The associated Ast::Step will be the last element of the test step's source:
test_step.source
#=> [
#=> #<Cucumber::Core::Ast::Feature "Feature: Something" (features/something.feature:1)>,
#=> #<Cucumber::Core::Ast::Scenario "Scenario: Only a test" (features/something.feature:3)>,
#=> #<Cucumber::Core::Ast::Step "Given : the fields" (features/something.feature:4)>
#=> ]
To access the Ast::Step multi-line argument, check the multiline_arg. If a data table has been specified, an Ast::DataTable will be returned. Otherwise, an Ast::EmptyMultilineArgument will be returned. You can check if the returned value is a data table by calling data_table?.
As an example, the below would iterate through each test step and output the data table if defined:
Before do |scenario|
scenario.test_steps.each do |test_step|
multiline_arg = test_step.source.last.multiline_arg
puts multiline_arg.raw if multiline_arg.data_table?
end
end
I am using LoadRunner to test the performance of an application which is a Siebel CRM based application. The issue I am facing is I am not able to get the SRN number which is unique for each of the session.
The code I am using to capture SRN is below
//HELLO YOUR CODE STARTS HERE.....FOR MANUAL CORRELATION
web_reg_save_param("Siebel_SRN",
"NOTFOUND=ERROR",
"LB=SRN`",
"RB=`",
"Ord=All",
"Search=All",
"IgnoreRedirections=Yes",
"RelFrameId=All",
LAST);
lr_output_message( "Siebel_SRN value is %s", lr_eval_string( "{Siebel_SRN}" ) );
//HELLO YOUR CODE ENDS HERE.....FOR MANUAL CORRELATION
If I search by SRN` I am able to see the SRN value.
Below is the response I am getting from the server. I am setting the boundary correctly ( I believe so ) but not able to get the SRN value.
vuser_init.c(161): 7/23048/scripts/HICalendarUI.htm`sui`false`vfn`_sweclient._swecontent._sweview`IsWebSocket
vuser_init.c(161): BSReady`false`WebSocketServerPort``SweBusyTimer`30`lt`1471312453347`MR1`Y`cqt`-1`ui`L17LOA
vuser_init.c(161): D`IsAutoOn`false`ect`Link`SRN`ABrcHGKVMlEGktXB3ekmRUEOy6rYzkMmy7OicIW0yHMb`ec`<span class=
vuser_init.c(161): \\"siebui-icon-icon_select\\"><img src=\\"images/icon_select.gif\\" border=\\"0\\" align=\\
vuser_init.c(161): "absmiddle\\" alt=\\"Pick Applet\\" title=\\"Pick Applet\\" >\\<\\/span>`cks`1-14TA9_DHHS
vuser_init.c(161): +L17_43%7c1470288710%7c1471223560_0_23048__L`vs`15.9.0.0 SIA [23048] ENU`USC`1`IsMsgBarEna
vuser_init.c(161): bled`true`lodc`0`IsMobileApplication`false`iri`<span class=\\"siebui-icon-icon_required\\"
vuser_init.c(161): ><img src=\\"images/icon_req.gif\\" border=\\"0\\" space=\\"0\\" hspace=\\"0\\" alt=\\"Req
I am getting the below message while replaying
No match found for the requested parameter "Siebel_SRN". Either the specified boundaries
were not found in the response or the matched text is longer than current max html parameter size of 999999 bytes.
The total length of the response is 15062 bytes. You can use
"web_set_max_html_param_len" to increase the max parameter size. [MsgId: MERR-26377] [Time:2016-08-16 11:54:27]
and the output for Siebel_SRN is
user_init.c(296): Registering web_reg_save_param was successful [MsgId: MMSG-26390]
vuser_init.c(307): Warning: The string 'Siebel_SRN' with parameter delimiters is not a parameter.
vuser_init.c(307): Siebel_SRN value is {Siebel_SRN} [Time:2016-08-16 11:54:21]
I am doing something silly. But not able to figure it out.Please help me in resolving this issue. Advance Thanks
First of all, make sure you placed the web_reg_save_param before the target request step (web_url, web_custom_request, web_submit_form etc.) as correlations should always be registered beforehand.
Also you should not pass Ord=All argument: it creates an array on parameters like Siebel_SRN_1, Siebel_SRN_2 and so on. In your case, there is only one instance of the SRN value in the response. IgnoreRedirections=Yes looks odd as well: ignoring HTTP redirections is not needed in general case. Check the official documentation for more information.
I am using FreeMarker Java Template Engine in Liferay Portal and I get this error:
19:55:00,260 ERROR [http-bio-80-exec-2][runtime:96] Template
processing error: "Error on line 290, column 1 in
924629#924665#3296702 request['theme-display'] is undefined. It can not
be assigned to themeDisplay"
I want to know what this number 924629#924665#3296702 identifies or mean?
companyId#companyGroupId#templateId
I have found what is the meaning of those numbers.
The first is the Company ID (ThemeDisplay.getCompanyId()) and the second number is the Company Group ID (ThemeDisplay.getCompanyGroupId()) and the last number is the ID of FreeMarker Template (Liferay templateKey)
I have a Meal object that stores pointers to n created objects "FoodInfo" using the key "MealItems".
When I query for the meal I take advantage of the [query includeKey:#"MealItems"] to fetch the items pointed to while fetching the "Meal".
This works swimmingly if the objects are created while online (ie. all are stored in the cloud db).
However, since I cannot assume access to the cloud at all time for this app I am now trying to enable the local datastore so I've changed my queries to use:
[query fromLocalDatastore];
and I've changed all of my objects' save methods to pinInBackgroundWithBlock followed by (assuming success of local save) saveInBackgroundWithBlock followed by (assuming failure) saveEventually.
To test this, I:
turned off wifi
ran the code to create a meal and then add newly created foods to it. This works with no error codes.
ran a report that then queries for the meal just created. This fails with the following:
Error: Error Domain=Parse Code=121
"include is invalid for non-ParseObjects" UserInfo=0x60800007f400 {
error=include is invalid for non-ParseObjects,
NSLocalizedDescription=include is invalid for non-ParseObjects,
code=121
} {
NSLocalizedDescription = "include is invalid for non-ParseObjects";
code = 121;
error = "include is invalid for non-ParseObjects";
}
Is this scenario not supported?
When I re-enable wifi, the meal is successfully added to the online db, but the query failure still happens when I run the query with the includeKey locally.
Am I missing something here? I'm quite surprised to see this failing. It seems like a really basic feature that should work whether local or cloud based.
Parse objects are not created until you save them. Try using saveEventually first before using pinInBackgroundWithBlock.