In Robot Framework how do I give the ctrl+c command?
I have tried this line but it does not work
${crtl_c} Evaluate chr(int(3)) SSHLibrary.Write Bare ${crtl_c}
In Robot Framework how do I give the ctrl+c command?
I have tried this line but it does not work
${crtl_c} Evaluate chr(int(3)) SSHLibrary.Write Bare ${crtl_c}
Use PyAutoGUI
PyAutoGUI works on Windows/Mac/Linux on Python 2 & 3. Install from PyPI with
pip install pyautogui
import pyautogui
def CntrlC():
pyautogui.hotkey('ctrl', 'c') #Performs ctrl+c
Now just import the py file and use CntrlC as the Keyword
${ctrl_c} evaluate chr(int(3))
SSHLibrary.Write Bare ${crtl_c}
Or else you can give the line in variables section:
***variable***
${ctrl_c} evaluate chr(int(3))
Just got this working. The problem with the answers above is that you need an equal sign.
${ctrl-c}= evaluate chr(int(3))
Write Bare ${ctrl-c}
Refering to a previous answer on an SO question where if you're on windows, the SendKeys python library is used to send actual key presses to the system. In case you're on a linux based system it pretty much depends on the GUI you're using and a few other factors. This SO Question has some good content that might help you.