当前位置: 动力学知识库 > 问答 > 编程问答 >

python - Confuse about Robot Framework data-driven sample? What is "C${}="?

问题描述:

I have done some research about this syntax but I can't find a meaning of it.

  • Could someone explain a little bit more of this "C${expression}="?

  • How is this different with ${expression}?

Thank you in advance.

original file is: https://bitbucket.org/robotframework/robotdemo/src/51f472687b6a46e88b7c179423f0f336e19497fc/data_driven.robot?at=master&fileviewer=file-view-default

网友答案:

In this context, C${expression}= is the string "C", followed by whatever is in the variable ${expression}, followed by the string "=".

This code has a keyword named Push buttons which takes as a single argument a string of characters representing buttons. When you call Calculate with an argument like 2+4, ${expression} will be 2+4, so C${expression}= is the string C2+4=. The Push Buttons keyword will then simulate pressing "C", "2", "+", "4", and "=".

分享给朋友:
您可能感兴趣的文章:
随机阅读: