How to use robot framework with python in eclipse and How to run the Robot framework tests in eclipse using python interpreters?

霸气de小男生 提交于 2019-12-04 22:09:07

You can use RED (Robotframework Editor), an extension for Eclipse available in the Eclipse Marketplace. Once you installed, simply go to "Run -> Run configurations..." and configure a run profile under "Robot". Eclipse will execute the following command on your test:

/usr/bin/python -m robot.run

You can check the logs in the "Message Log" view, and test results in the "Execution View".

Michael Tingey

Here's how I setup my Eclispe to run Pybot for Windows 7. You have to setup "External Tools", I don't have a high enough reputation to post images so see the steps below. Once you've setup an external tools configuration you'll use "Run-->External Tools-->Pybot".

HTH,

From the Eclipse tool bar:

  1. Run-->External Tools-->External Tools Configurations...
  2. From the "External Tools configurations" pop-up select "Program", then press the New button
  3. Fill in the following setting on the definition screen:
    • Name: Pybot (or a name of your choosing)
    • Location: C:\Python27\Scripts\pybot.bat (path to your pybot.bat file)
    • Working Directory: C:\workspace_42 (your Eclipse workspace)
    • Arguments: "${selected_resource_loc}"

If you want to execute Python's flavour of Robot Framework you must use either command line or the Robot IDE (RIDE). To run your tests from the command line you must:
1. Open the terminal
2. Navigate to the appropriate directory
3. Use the pybot command and then specify the folder/file containing your tests

eg.

pybot mytestfolder
pybot myfirsttest.txt
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!