https://www.youtube.com/watch?v=H-xshi33G7I
While Testing sometimes we need to take screenshots and send them to someone maybe as steps to reproduce a bug. It was a very time-consuming process as I had to first take the screenshot and go to word file paste that and then come back again run the application take screenshots to saved to doc and so on, so to decrease my efforts I created a python script that takes a screenshot and saves it to document
Download and install Python (v3.7+) on your system from the internet While installing make sure to select install pip and app python to path option
once done run "pip --version" in cmd to confirm the installation if you find a version of pip than run the following command in cmd to install the dependencies
Run below command in cmd to install dependencies
pip install python-docx PyAutoGUI pynput docx
OR
pip install python-docx
pip install PyAutoGUI
pip install pynput
pip install docx
save the python script to the location where you want to save the screenshots and document
then in cmd go to that path and execute
py saveImgToDoc.py
this will run the Python script
OR just double click on saveImgToDoc.py program
whenever you press PrtSc it will save the screenshot to a folder named shots and to end the program and create the document press "Ctrl_l + Esc"(Left control key + Esc key)
it will ask of the filename you want to save it as to enter the filename or just click enter, If you have entered the file name it will save as filename.docx otherwise, by default, it will save as testingScreenShots.docx
It will display a location where the screenshot is saved, where documents are saved.
Suggestions are most welcome Email: rakhejachetan@gmail.com, chetanrakheja@gmail.com