Option in the settings to alter the behaviour to report the keyword name
Hi In report the name of keyword documentation appear , and not the name of the Keyword For example in my test case i used those keywords : 1) Given the user sends get on endpoint "/api/v1/" 2) Given the user sends POST on endpoint "/api/v1/" and body "{"label":"Temperature"}" The report will show documentation keywords : 1) Send GET request to the given endpoint. Use this keyword when no headers nor query parameters needed. 2) Send POST request to the given endpoint. Use this keyword when no headers needed. Enable to write directly the body parameter in the keyword title.
If possible to add an option in the settings to alter the behaviour to report the keyword name. I think it would be better as a scenario wide setting, sowe can set the setting for the complete rfs
Transcript from the discord chat, in case it helps someone else with the potential work around and for the background to this issue.
Anker01 — Today at 00:06
Also i have another question In report the name of keyword documentation appear , and not the name of the Keyword For example in my test case i used those keywords : 1) Given the user sends get on endpoint "/api/v1/" 2) Given the user sends POST on endpoint "/api/v1/" and body "{"label":"Temperature"}" The report will show documentation keywords : 1) Send GET request to the given endpoint. Use this keyword when no headers nor query parameters needed. 2) Send POST request to the given endpoint. Use this keyword when no headers needed. Enable to write directly the body parameter in the keyword title.
is there any workaround to have the initial keyword in results , not documentation infos , because it is very confusing ? (edited)
damies13 — Today at 00:23
Yes there is sort of a work around, but only for custom keywords: https://github.com/damies13/rfswarm/blob/master/Doc/Preparing_for_perf.md#keywords
I had actually thought about changing the behaviour at one stage to something similar to what you mentioned but it would have broken the ability to control the name the way it is now. Thinking about you example, I could probably add an option in the settings to alter the behaviour to report the keyword name. Actually requests library was why I was thinking about it but when I investigated further I found requests library actually behaves differently to most other Robot framework libraries, so I kept the behaviour that works best for the majority of Robot framework libraries If you want you can raise a feature request to add an option in the settings to alter the behaviour to report the keyword name. I guess if you do you can indicate if you think this would be better as a scenario wide setting or per script setting (I'm initially thinking it would be probably better as per script)
Note to self: Notes below for the changes need on the agent, this will need to be wrapped in an IF based on the setting in the manager gui, so this will need an RFS_ variable to pass the setting from the manager through the agent to the listener.
Anker01 — Today at 18:08
ok i was thiking to change : fd.append(" ResultName = attrs['doc']") to fd.append(" ResultName = name") [18:08] it will not temporarily do the job ? (edited)
damies13 — Today at 22:19
If you replace these 4 lines: fd.append(" if self.msg is not None and 'message' in self.msg and not istrace:") fd.append(" ResultName = self.msg['message']") fd.append(" elif 'doc' in attrs and len(attrs['doc'])>0:") fd.append(" ResultName = attrs['doc']")
With just fd.append(" ResultName = name")
Yes that would do what you want and just report the keyword, after making that change make sure to delete RFSListener2.py as well to ensure it's recreated with the change
Work in progress
| Scenario Settings | Test Row Settings |
Merged into v1.4.0 branch