January 26, 2020

ObjectiveTest Tutorial | Test Management System

This is a tutorial on ObjectiveTest, which is a cloud-based test management tool. ObjectiveTest has features like Plan releases, Gather requirements, Manage test cases, Manage test runs, Defect management and Administration. At present, ObjectiveTest is free for small QA teams (up to 10 users for 12 months). Please view the ObjectiveTest tutorial video or read on... ObjectiveTest is available from their website, where we can click on the PRODUCTS tab and then click on the Demo Instance link. In the demo instance, the Username and Password is pre-populated. So, we can simply click the Login button.

The Projects drop down is at the top right, where we can select any project. Let us select the default project. The first task is to Plan releases. We can select any release by clicking  it. Each release needs to be linked to requirements. We can click the Add button in the Link Requirements section to open the Link Requirements window as shown below. A single release may have one or more builds.

January 19, 2020

Python tutorial 19 | Classes and Instance Objects

This is the last tutorial in the Python Tutorials for Beginners. This Python beginner tutorial explains Python classes and Python objects. Please view the Python video tutorial 19 or read on... What is class in Python programming? A class is a template or a pattern to create objects. Python classes support object-oriented programming. A Python class has class attributes. Also, a Python class can be updated after it's definition. The objects created from a Python class are called instance objects. The Python class syntax is:

class ClassName:
  class body

In the above class format, the Python keyword class is followed by the name of the class, then a colon and then one or more Python statements. Now, let us see Python class examples.

# Python code
class Tree:
    """A class that represents a tree""" # doc string - optional
    species = 'Pine' # class attribute - data attribute
    def describe_me (self): # class attribute - class method
        return 'this is a tree'

# print the data attribute of the Tree class i.e. print 'Pine'
print (Tree.species)
# print the documentation string of the Tree class
print (Tree.__doc__)
# update the Python class (after class definition)
Tree.species = 'Aspen'
print (Tree.species)

# class instantiation i.e. create objects
tree1 = Tree()
# note that there is no need to provide the self argument when calling the class method, describe_me()
print (tree1.describe_me(), 'of species', tree1.species)
# find out if tree1 is an object of the class Tree or not
print (isinstance(tree1, Tree))

January 12, 2020

Python tutorial 18 | Dictionaries

Moving on to the next tutorial in the Python Tutorials for Beginners. This Python beginner tutorial explains the dictionary data structure. Please view the Python video tutorial 18 or read on... What is dictionary in Python programming? It is a group of key value pairs, that may be stored in any order. The Python dictionary keys can be strings or numbers (immutable data types only). Also, each dictionary key is unique. Python dictionaries are mutable, meaning that any dictionary item may be updated. In other programming languages, dictionaries may be called associative arrays. The dictionary syntax is:

{key0:value0, key1:value1,..., keyn:valuen}

In the above  dictionary format, the key value pairs are separated by commas. The first item is key0:value0, the second item is key1:value1 and so on. The entire group of key value pairs is enclosed within curly braces. Now, let us see Python dictionary examples, Python dictionary operations and Python dictionary functions.

# Python code
num_to_words = {1:'one', 2:'two', 10:'ten', 3:'three', 5:'five'}
# print the Python dictionary (the items may be in any order)
print (num_to_words)
# print the Python dictionary item's value for the given key i.e. print 'three'
print (num_to_words[3])
# modify the Python dictionary item's value for the given key
num_to_words[1] = 'unity'
# print the updated value i.e. print 'unity'
print  (num_to_words[1])

January 06, 2020

Python tutorial 17 | Tuples

Let us go to the next tutorial in the Python Tutorials for Beginners.  This Python beginner tutorial explains the tuple sequence data type. Please view Python video tutorial 17 or read on... What are tuples? In Python programming, a tuple is a sequence of items. The tuple items may be of the same data type or different data types like integers, floats, strings, lists or other tuples. The tuple items are commonly of different data types. Tuples are immutable, meaning that after a tuple is defined, no tuple item can be updated. Also, a tuple that is an item in another tuple is called a nested tuple. The tuple syntax is:
item0, item1, item2,..., itemn

The tuple syntax can also be the items within parentheses.
(item0, item1, item2,..., itemn)

In the above tuple format, the items are separated by commas. The item indexes start from 0.  Now, let us see Python tuple examples and tuple operations with Python examples.

January 01, 2020

Python tutorial 16 | Exception handling part 2 | Try except statement

Moving on with Python Tutorials for Beginners, let us go to the next one from Exception Handling part 1 tutorial. This Python beginner tutorial further explains how to handle any exception in Python. Please view the Python video tutorial 16 or read on... I have explained what are exceptions in my previous Python tutorial 15. In Python programming, the Python try statement syntax can also have an optional else clause:

try:
    try clause
except named_exception(s):
    except clause

else:
    else clause

In the above try statement format, we can put code in the else clause that will only be run when no exception is thrown in the try clause. In other words, the else clause should have code to be be run after the successful completion of the try clause. The else clause may be written after multiple excepts also. Now, let us see the else clause Python examples.

# Python code example
# This Python code, as is, should run the else clause.
try:
    i = 10 # if you comment this line, it should generate an exception and skip the else clause
    print (i*2)
except NameError:
    print ('Please define the variable first.')
else:
    print ('Printed the double of the value!')

The Python try statement syntax can also have an optional finally clause:
try:
    try clause
except named_exception(s):
    except clause

else:
    else clause
finally:
    finally clause