问题
I recently started using robotframework
with the Selenium2Library
. I haven't tested using Selenium before, but I know it is possible to record tests using Selenium. In RobotFramework
, it says, "it is not possible". I mean even for a simple login test, I need to write the test, specifying the id of username, password and submit button.
However, is there any way by which these tests can be recorded using robotframework
? such as clicking on a text box, entering a string and then clicking on submit button etc., and automatically generate the test case source code instead of having me to write the test cases.
Is this possible with robotframework
or any external library
that it supports?
回答1:
robotframework wasn't designed to be a record-and-play tool, and has nothing built-in to support that.
There was someone who wrote a selenium IDE plugin that would generate robot keywords, but that was years ago. The github repository is here: https://github.com/denschu/selenium-ide-format-robotframework
The code hasn't been touched since 2012, so I doubt it's of much use.
回答2:
Using this Firefox add-on, FireRobot we can generate most of the code and also using this you can select the elements on the screen and get related code suggestions on right click likeWait Until Element Is Visible
Click Element
and all operations to perform on the selected element.
来源:https://stackoverflow.com/questions/33896990/how-to-record-test-cases-with-robotframework