How To Install/Set Up Protractor

Step 1: I downloaded Visual Studio Code to use as my source code editor

 

Step 2: I downloaded Node.js

  • You can download this from the Node.js website, “https://nodejs.org/en/download/
  • In case you don’t know what Node.js is: Node.js is an open-source, cross platform JavaScript run-time environment that executes JavaScript code outside of a browser. “

 

Step 3: Create a folder on your desktop called “Project” (or whichever name you choose)

 

Step 4: Open Visual Studio Code, click on File, click on Open and double click on the folder that you created on your desktop (“Project”)

 

Step 5: A welcome message will appear on Visual Studio Code, click “New File” under “Start” heading

 

Step 6: Open your terminal in Visual Studio Code

 

Step 7: In your terminal, type “npm init” and press enter – (this creates json package)

 

Step 8: You can fill out the details it requires (package name, version, description, entry point, test command, git repository, keywords, author, licence) – you do not have to fill out everything.  After you have filled out details, it will ask “Is this OK?”, click enter to say yes.

 

Step 9: Type “npm install” – (this installs all modules listed as dependencies in json package)

  • You should see two json package files appearing under Projects (“package-lock.json” and “package.json”)

 

Step 10: Type “sudo -i”  – (sudo lets you run commands in your own user account with root privileges)

  • if you have a password for your PC, you will have to type that in and press enter

 

Step 11: Type “npm install -g protractor” and press enter – (this will install Protractor and Webdriver-Manager)

 

Step 12: Type “npm install typescript” and press enter to install TypeScript

 

Step 13: Type “webdriver-manager update” and press enter

 

Step 14: Type “webdriver-manager start” and press enter

 

You would need to do Step 13 and Step 14 every time you start your PC (to update and start webdriver). Also, don’t forget to create a .conf file and a .spec file to run your protractor tests. You use “Protractor conf.js” in your terminal to run your tests. Look at the Protractor website to see how to create and run your first test, https://www.protractortest.org/#/tutorial, this website will be very helpful as a starting point 🙂 

The Role of the Tester

Last week, I started reading a book called “Lessons Learned in Software Testing: A Context-Driven Approach”. It gives lessons in each chapter that I think will help any software tester in their testing journey. Chapter 1 is called “The Role of the Tester” and it addresses what testers are supposed to do for a project.

 

Lesson 1: You are the headlights of the Project

  • Some projects are easy and simple, like driving during the day, but most projects are tough, and it may be more like driving a truck, off road, at night. This paints a pretty good picture about how different projects can be. As the tester, the book mentioned that you light the way, almost like a light shining on the road ahead so that the team can see where they are, what is ahead and how close they are driving to the edge. Testing is done to find information, and critical decisions get made from that information. SO remember, you are the light 🙂 

 

Lesson 2: Your mission drives everything you do

  • Find out what is expected to you and have a clear mission

    Some examples may be to:

  • Find important bugs fast
  • Provide a general assessment of the quality of the product
  • Make sure that the product meets a certain standard
  • Improve product quality
  • Follow a certain set of methods or rules
  • Help your clients improve their processes
  • Do whatever is necessary to satisfy particular clients
  • Etc.

 

Lesson 3: You serve many clients

  • Testing is a service role and you need to remember that the service you provide is very important.

 

Lesson 4: You discover things that will “bug” someone whose opinion matters

  • As a tester, it is your duty to report your concerns, if the client does not listen, it is their choice.

 

Lesson 5: Find important bugs fast

  • Test things that have been changed first
  • Test core functions first
  • Test capability before reliability
  • Test common situations before testing situations unlikely situations
  • Know the product you are testing and also know the people who are going to be using it

 

Lesson 6: Run with the programmers

  • Support the programmers and give them feedback as soon as possible

 

Lesson 7: Question everything, but not necessarily out loud

  • To test well, you need to question
  • If you find yourself testing and you have no questions, take a break

 

Lesson 8: You focus on failure, so your clients can focus on success

  • Testing is the only role that does not directly focus on success (it can be seen as negative)
  • Testers focus on failure because it improves their chances of finding it. Look for key problems in the product with all your creativity and skill. If you don’t find them, they can’t be fixed, and then the users may find them for you. By finding what’s there to find in the product, you help the project team learn more about their own skills and the product’s risks, and you help them make the product better, more supportable, and probably more successful in the marketplace.”Chapter 1 of “Lessons Learned in Software Testing: A Context-Driven Approach”

 

Lesson 9: You will not find all the bugs

  • It is not possible to find every bug

 

Lesson 10: Beware of testing completely

  • “Complete” testing can mean many things (make sure you clarify what “complete” or “done” means)

 

Lesson 11: You don’t assure quality by testing

  • Testers don’t break the product; it was already broken. Quality comes from the people who created the product, but that is a heavy burden to bear so we help deal with the burden more effectively (it is a team effort)

 

Lesson 12: Never be the gatekeeper

  • Don’t be completely in control of the release (when testers control the release, they also must bear the full responsibility for the quality of the product)

 

Lesson 13: Beware of the not-my-job theory of testing

  • Do not adopt this philosophy
  • Also, find out what is expected of you

 

Lesson 14: Beware of becoming a process improvement group

  • You can work on improving the process as a team, but be careful not to criticise

 

Lesson 15: Don’t expect anyone to understand testing, or what you need to do it well

  • Remember that it’s up to you to tell your clients what you need and explain testing to them

Writing Test Cases

This week I am focusing on writing test cases and I have been doing research on how to write them effectively. According to the ISTQB glossary, the definition of a test case is, “A set of preconditions, inputs, actions (where applicable), expected results and postconditions, developed based on test conditions. “

Different companies have different test case templates which work for them according to their likes and needs. Here are some of the fields that are included when writing a test case:

  • Test Case ID – a unique ID is needed for each test case, eg: “TC_1”
  • Test Name – test case title, eg: “Verify login page with valid username and password”
  • Test Description – this is describing the test objective
  • Pre- Conditions – prerequisites that need to be completed before test execution
  • Test Steps – this is a list of all execution steps. It should be detailed and in order from beginning to end
  • Test Data – data that can be used in your test case such as username and password for login, etc.
  • Expected Results – this is how we expect the function to work after testing it
  • Actual Results – this describes the system behaviour after test execution
  • Status – to say if the test passed or failed
  • Some others could include Test Priority, Test Designed By, Test Design Date, Test Executed By, Test Execution Date, etc.

 

There are many ways to make sure you are writing effective and good test cases:

  • You should make sure that your test cases are simple and clear. Anyone should be able to read them and know what to do. 
  • Try to get as much coverage by making sure you write test cases to check all requirements. Test all function/conditions.
  • Use different techniques to help find bugs. You can use techniques such as Boundary Value Analysis, Equivalence Partitioning, Error Guessing, etc.
  • Ask a colleague or someone to review your test cases.

Head First Python

I started reading Head First Python, 2nd Edition this week to start learning Python for Automation Testing. I am thoroughly enjoying it so far. It is very helpful that it has images, humour and good lessons in it- it makes it easier and more entertaining to read than just a long book filled with information that can be quite difficult to take in. I have only read chapter 1 so far and i am doing the exercises and making notes as I go.

 

Here are some starting hints that I took down:

  • Python comes with a built-in IDE called IDLE. IDLE lets you create, edit and run your code.
  • IDLE interacts with the Python interpreter (the interpreter runs your code).
  • Python comes with a standard library (provides access to a lot of reusable modules).
  • You make decisions with the if/ elif/ else statement.
  • Functions are inside modules, inside the standard library.

 

Here are a few things I have learnt how to do from this book so far:

1- To find out what system your interpreter is running on:

     >>> import sys

     >>> sys.platform

 

2- To see what version of Python is running:

     >>> print(sys.version)

 

3- To see the name of the folder your code is operating with:

     >>> import os

     >>> os.getcwd()

 

4- To see todays date:

     >>> import datetime

     >>> datetime.date.today()

 

5- To see date as a string:

     >>> datetime.date.isoformat(datetime.date.today())

 

6- To see what the time is:

     >>> import time

     >>> time.strftime (“%H:%M”)

 

7- Iterating over a sequence of objects:

     >>> for i in “Hi!”:

                 print (i)

 

8- Iterating a specific number of times:

     >>> for num in range (3):

                print (‘Python’)

 

9- Use sleep function to pause execution of code:

     >>> import time

     >>> time.sleep (5)

 

10- Generate a random integer

     >>> import random

     >>> random.randint (1,60)

 

I am learning that one of the great strengths of Python is that you can get a lot done with a few lines of code. Most tutorials that I have tried always start with Hello World, but this book dives a little bit deeper than that, which is great. I look forward to learning how to do much more and eventually using Python for Test Automation.