How to get System Name and System Information in the Robot Framework

1,359 views
Skip to first unread message

Jayamurugan Jay

unread,
Jun 20, 2018, 4:37:49 AM6/20/18
to robotframework-users
Hi .

 How to get System Name and System Information in the Robot Framework, while running the scripts.
I had Local desktop and Azure Machine which i had running the scripts in 2 different machines. In Reports i need those system details which will clarify the Machines details.
Thanks

Regards,
Jayamurugan

adam.wyp...@gmail.com

unread,
Jun 20, 2018, 5:33:56 AM6/20/18
to robotframe...@googlegroups.com
I think if you have 2 different systems then is worth to create Python keyword which will return you an informations (i.e. as map), which you requires https://stackoverflow.com/questions/3103178/how-to-get-the-system-info-with-python 

Geist Eng

unread,
Jul 4, 2018, 6:27:56 PM7/4/18
to robotframe...@googlegroups.com
This is exactly how I do it.  I have a Keyword that is run by Suite Setup that puts this info in the run documentation:

Set Test Run Documentation
| | Set Suite Documentation | API System Test run                   | append=False | top=True |
| | Set Suite Documentation | \| *Version:* ${HOST VERSION}         | append=True  | top=True |
| | Set Suite Documentation | \| *GUI Version:* ${HOST GUI VERSION} | append=True  | top=True |
| | Set Suite Documentation | \| *Name:* ${HOST DEVICE NAME}        | append=True  | top=True |
| | Set Suite Documentation | \| *Type:* ${HOST DEVICE TYPE}        | append=True  | top=True |
| | Set Suite Documentation | \| *Platform:* ${HOST PLATFORM}       | append=True  | top=True |
| | Set Suite Documentation | \| *FW Type:* ${HOST FIRMWARE}        | append=True  | top=True |
| | Set Suite Documentation | \| *Hostname:* ${HOST HOSTNAME}       | append=True  | top=True |
| | Set Suite Documentation | \| *IPv4:* ${DUTHOST}                 | append=True  | top=True |
| | Set Suite Documentation | \| *MAC:* ${HOST DEVICE MAC}          | append=True  | top=True |
| | Set Suite Documentation | \| *ID:* ${HOST SERIAL NUMBER}        | append=True  | top=True |
| | Set Suite Documentation | \| *Lang:* ${HOST DEFAULT LANG}       | append=True  | top=True |
| | Set Suite Documentation | \| *Units:* ${HOST UNITS}             | append=True  | top=True |
| | Set Suite Documentation | \| *Start uptime:* ${HOST DUT UPTIME} | append=True  | top=True |


I have a Keyword that makes an api call to set all the vars listed above.


Pekka Klärck

unread,
Jul 8, 2018, 12:39:49 PM7/8/18
to geis...@gmail.com, robotframework-users
Instead of using `Set Suite Documentation`, it might be better to use
`Set Suite Metadata`.

Cheers,
.peke
> --
> You received this message because you are subscribed to the Google Groups "robotframework-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
> To post to this group, send email to robotframe...@googlegroups.com.
> Visit this group at https://groups.google.com/group/robotframework-users.
> For more options, visit https://groups.google.com/d/optout.



--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org

Geist Eng

unread,
Jul 10, 2018, 4:05:23 PM7/10/18
to robotframe...@googlegroups.com
This is one of the things I love about your Framework, Peke.  There is so much functionality one can often discover a new gem. 

I wrote my KW above 3 years ago when first started with RF.  And while the KW gives a compacted section of info, Set Suite Metadata is much better suited to some of the info I have to report.

Cheers, Paul.

Pekka Klärck

unread,
Jul 11, 2018, 3:21:35 AM7/11/18
to geis...@gmail.com, robotframework-users
Thanks for the compliments! Remember also that there are --doc and
--metadata options to set these values from the command line as well.

Cheers,
.peke
ti 10. heinäk. 2018 klo 23.05 Geist Eng (geis...@gmail.com) kirjoitti:
>
> This is one of the things I love about your Framework, Peke. There is so much functionality one can often discover a new gem.
>
> I wrote my KW above 3 years when first started with RF. And while the KW gives a compacted section of info, Set Suite Metadata is much better suited to some of the info I have to report.
>
> Cheers, Paul.
>
> On Sunday, July 8, 2018 at 11:39:49 AM UTC-5, Pekka Klärck wrote:
>>
>> Instead of using `Set Suite Documentation`, it might be better to use
>> `Set Suite Metadata`.
>>
>> Cheers,
>> .peke
>>
Reply all
Reply to author
Forward
0 new messages