Sorry for big delay between posts, it was a problem, because of lot of work 🙂
During the work in automation project a lot of libraries will be changed\added\removed. And we need to keep then in up to date.
List of libraries also needed for setup new machine or test machine where you will run your tests. In python you can simply run command to update or create file with list of libraries: ‘pip freeze -> requirements.txt’
When you set up new machine you can simply run another request to setup all libraries: ‘pip install -r requirements.txt’
So let’s talk about libraries for our project.
I’ve took file requirements.txt from our project. A lot of libraries we’re really doesn’t use, but I haven’t time to refactor and remove them.
behave==1.2.5 comtypes==1.1.3 EasyProcess==0.2.3 olefile==0.44 parse==1.6.6 parse-type==0.3.4 Pillow==4.0.0 pyodbc==3.1.1 pypiwin32==219 pyscreenshot==0.4.2 pywinauto==0.6.0 robotframework==3.0 selenium==3.0.2 six==1.10.0
- behave – it’s library which needed for proper work of Gherkin framework and running our tests.
- Pillow – library for making screenshots
- pyodbc – this library we’re using for connection with DB, run script. In some cases I’m using db for compare results before and after Test
- pyscreenshot – it’s the second lib for making screenshots
- pywinauto – it’s our main library for connect to our app 🙂
Also python has a lot of included libraries which we also use in our project:
- time – this lib can help us to set some freezes between steps. In our app we sometimes using this lib, in case when we can’t set wait’s. My recommendation – use this lib less as you can
- PIL – after trying to use two libs Pillow and pyscreenshot – i’ve found that Python has own lib. This lib can grab screenshots and save them into folder. Problem of this lib, that we can save files only into exist folders. We can solve this problem with another lib: OS
- OS – lib PIL can’t save file into specific folder. With this lib we can save file into any folder, if folder doesn’t exist – this folder will be created.
- datetime – this lib can grab current time in different formats – year, month, date, time, seconds, etc.
- re – used for regular expression operations. You can use it for parsing something. We ‘re using for parsing doc number from title for example.
- random – just for generating random numbers
Thanks for your attention, i hope my post will be helpful for you.
In next posts i will tell you about GIT and plans for CI