I'm trying to find a Keyword or automatic variable that contains the current platform that the robot framework suite is being run on.

I assume it must know to allow it to access the file system.

I wanted to use this to load variable resources depending on the current platform

有帮助吗?

解决方案

You can use the Evaluate keyword to get the platform from python using sys.platform:

*** Test Cases ***
| Example which logs the current platform
| | ${platform}= | Evaluate | sys.platform | sys
| | log | ${platform}

The exact values that are returned are documented in the sys.platform documentation.

For more fine-grained information, such as processor type, you can use the platform module in a similar manner.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top