Skip to content

robot.testdoc not generating Json properly for reserved keywords #3846

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sandhyakunamneni opened this issue Feb 8, 2021 · 1 comment
Closed

Comments

@sandhyakunamneni
Copy link

.robot file contains this "for"(reserved keyword) loop
FOR ${element} IN @{elements_list}
Log "iterate list ${element}"
END

Whereas Json has type='FOR' instead of 'KEYWORD' and no proper arguments. There is no information about inner keywords (i.e ex:Log) inside for loop
{
"arguments":"",
"name":"${element} IN [ @{elements_list} ]",
"type":"FOR"
}

Capture
Capture2

@pekkaklarck
Copy link
Member

Earlier Robot Framework mapped FOR loops internally to keywords and this approach was also used by Testdoc. Now that we also have IF/ELSE structures, we have been enhancing the model (#3749) and nowadays there are separate objects for representing FOR and IF constructs. Testdoc still internally only has keywords, though. The reason is that it makes showing all steps easier and this same approach is also used by log.html created during execution. I'm not sure is changing that worth the effort and it certainly won't happen in RF 4.0. The reason I don't consider this high priority is that both Testdoc output and log.html are to be opened on a browser and how data is represented internally is pretty much an implementation detail.

Although I don't think changing Testdoc in this regard is worth the effort, I'm not against someone else doing that and providing a PR. I also think having a way to convert a test suite structure into JSON would be handy in general, but such functionality doesn't need to be tightly tied to Testdoc. We could even make it so that same JSON data could be used as input for Robot.

@pekkaklarck pekkaklarck closed this as not planned Won't fix, can't repro, duplicate, stale May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants