Posts

Showing posts with the label Automation tests

Selenium - brief

Image
Selenium is an umbrella project (Open-Source) for a range of tools and libraries that enable and support the automation of web browsers. Selenium Modules: Selenium - IDE Selenium - RC Selenium - Webdriver Selenium - Grid Appium*   Selenium IDE The first project in selenium (2004), a t first, was only a firefox plugin for record tests. Records in 2004 were trash... if we would record 500 tests and something in my core application was a change, you should record from the beginning... Selenium RC (the second project, 2006) called Selenium 1 Now we could code our tests (with several languages) support with several browsers How ? They create Selenium RC Server (RC = Remote Control), the server translates the code from all those languages to the only language that the browsers know… JavaScript... Const: The biggest const was performance.. a normal test for example 30 steps, could take 20 min !   Selenium Webdriver (2009) called Selenium 2 Now to every browser will be his driver to ...
Image
A framework (based on python) that makes it easy to write small tests, yet scales to support complex functional testing for applications and libraries. Why do we need Pytest ? why selenium is not enough ? Selenium performs an action in the browser. But how we'll create a test to assert our case ? How we’ll run test suite (a bunch of test cases ) ? That's right... we need PyTest... Build our code structure (Fixtures) Create Test Suites Test Runners Provide Assertions Let's not waste time and start coding… Create Folder My_tests Create python file test_utils 1 def twice(x): 2 return x * 2 3 4 5 def thrice(x): 6 return x * 3   Code conventions: Files start (or end) with: test_ Methods start with: test_ Class starts with: Test_ Install PyTest: Install: pip install -U pytest Verify correct version: pytest --version How to tun PyTest ? Note : When you run  pytest , by default, it will look for tests in all directories and files below the current directory. We would...