The second time the case is executed, the Log window does not display data, such as
Cause: When the case runs, the IEDriverServer.exe or Chromedriver.exe process is still running after you run it using IE or the Chrome browser.
Solution:
Method one: In Task Manager, end the post IEDriverServer.exe or chromedriver.exe process
Method Two:
Save the following code as a batch and run it manually after each run:
taskkill/f/im Chromedriver.exe
taskkill/f/im IEDriverServer.exe
Method Three: Encapsulation into keywords
Step1:
def close_process (self, process_name):
"" "Close a process by process name." "
If Process_name[-4:].lower ()! = ". exe":
Process_name + = ". exe"
Os.system ("taskkill/f/im" + process_name)
Step2:
Save the above file to the Py file, then reference it in ride and create the keyword
Teardown
Close Process Chromedriver #谷歌
Close Process Iedriverserver #IE
Step3:
Add teardown to test setting:
Settings * * *
Test Teardown Teardown
Robotframework-----The second time the case is executed, the Log window does not display data