Hiyah, haven’t updated for a long time, in recent months have been busy in quality department for the construction of the platform, because is a new team so many things are done from scratch, this time did a lot of associated with automation, code quality and efficiency of engineering, the next period of time will slowly to sort out some of the interesting things to share with you.

Today we are going to introduce a module for automating command line interactions in Python. The reason for this requirement is that we want to make some tedious command line interactions transparent so that they are much more user-friendly and cheaper to use.

Here is a typical command line operation that requires user interaction. After executing the command, the user will be prompted to enter the file name of the test script, and after entering the press enter, the user will be prompted to enter the path of the APP. How to automate this process?

Shutit, in fact, there is a tool pexpect, but I have tried many times have failed to achieve the desired effect, and most of the solutions given on the web are also for SSH login automation, for a common interactive command line does not support, of course, may be I use the posture is wrong? If you have pexpect implementation, please contact me


FullStackEngineer public account, more to share