To tell the truth, there are some wonderful flowers in this demand , Because the normal framework will not use this requirement , Or pure Python To achieve , Or pure RobotFramework To achieve , use RobotFramework Can be called normally Python Of , But the other way around, it hurts a little .
Our current framework is based on RobotFramework Realized , But because of RobotFramework Scalability is too low in some places , Sometimes use Python To achieve more efficiency , But the existing RobotFramework There has been a lot of sedimentation in the project , If you rewrite this part completely , It's too much work , So there is such a wonderful demand . After searching the Internet for more than half a day , Finally gave up , I can only look at the source code to realize it .
There is a very simple and crude implementation , use RobotFramework Write a test case , Then the use case calls the corresponding keyword , Reuse Python To execute this use case , To achieve the function of calling keywords , But there are two drawbacks .
The whole part is not difficult to implement , It's just RobotFramework There is no one to interpret the source code of , There is no good translation document , In fact, it was used in the previous analysis article robot.api This point has been covered in , The implementation code is as follows :