Test Automation For Web-Based Applications

Slides:



Advertisements
Similar presentations
Making Choices in C if/else statement logical operators break and continue statements switch statement the conditional operator.
Advertisements

I210 review Fall 2011, IUB. Python is High-level programming –High-level versus machine language Interpreted Language –Interpreted versus compiled 2.
Structured programming
Intro to Python Paul Martin. History Designed by Guido van Rossum Goal: “Combine remarkable power with very clear syntax” Very popular in science labs.
Python Control of Flow.
4. Python - Basic Operators
Chapter 2 Control. "The Practice of Computing Using Python", Punch & Enbody, Copyright © 2013 Pearson Education, Inc. Repetition, quick overview.
CIS Computer Programming Logic
Python Control Flow statements There are three control flow statements in Python - if, for and while.
CPTR 124 Review for Test 1. Development Tools Editor Similar to a word processor Allows programmer to compose/save/edit source code Compiler/interpreter.
Chapter 4: Decision Making with Control Structures and Statements JavaScript - Introductory.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
>>> # Fibonacci series:... # the sum of two elements defines the next... a, b = 0, 1 >>> while b < 10:... print b... a, b = b, a+b WHILE.
If statements while loop for loop
Introducing Python CS 4320, SPRING Resources We will be following the Python tutorialPython tutorial These notes will cover the following sections.
Python uses boolean variables to evaluate conditions. The boolean values True and False are returned when an expression is compared or evaluated.
CSCI/CMPE 4341 Topic: Programming in Python Review: Exam I Xiang Lian The University of Texas – Pan American Edinburg, TX 78539
9/14/2015BCHB Edwards Introduction to Python BCHB Lecture 4.
Exam 1 Review Instructor – Gokcen Cilingir Cpt S 111, Sections 6-7 (Sept 19, 2011) Washington State University.
Python 101 Dr. Bernard Chen University of Central Arkansas PyArkansas.
By Austin Laudenslager AN INTRODUCTION TO PYTHON.
Chapter 10 Loops: while and for CSC1310 Fall 2009.
1 CS 177 Week 6 Recitation Slides Review for Midterm Exam.
Midterm Exam Topics (Prof. Chang's section) CMSC 201.
Introduction to Computing Using Python Repetition: the for loop  Execution control structures  for loop – iterating over a sequence  range() function.
Flow Control in Imperative Languages. Activity 1 What does the word: ‘Imperative’ mean? 5mins …having CONTROL and ORDER!
Loops (While and For) CSE 1310 – Introduction to Computers and Programming 1.
Computer Program Flow Control structures determine the order of instruction execution: 1. sequential, where instructions are executed in order 2. conditional,
 Python for-statements can be treated the same as for-each loops in Java Syntax: for variable in listOrstring: body statements Example) x = "string"
PH2150 Scientific Computing Skills Control Structures in Python In general, statements are executed sequentially, top to bottom. There are many instances.
Introduction to Python
G. Pullaiah College of Engineering and Technology
Topic: Iterative Statements – Part 1 -> for loop
Python Loops and Iteration
Control Flow Constructs: Conditional Logic
Python: Control Structures
CS-104 Final Exam Review Victor Norman.
Computer Programming Fundamentals
Basic operators - strings
C++, OBJECT ORIENTED PROGRAMMING
Selenium WebDriver Web Test Tool Training
For loop, definite vs indefinite iteration, range, random
Think What will be the output?
Python Useful Functions and Methods
Repetition: the for loop
Python - Loops and Iteration
Arithmetic operations, decisions and looping
Introduction to Python
Python Primer 2: Functions and Control Flow
Structured Program Development in C
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Test Automation For Web-Based Applications
3. Decision Structures Rocky K. C. Chang 19 September 2018
Python Tutorial for C Programmer Boontee Kruatrachue Kritawan Siriboon
Introduction to Programming Using Python PART 2
Introduction to Python
Introduction to Python: Day Two
More elements of Python programs
Topics Sequences Lists Copying Lists Processing Lists
Introduction to Python
The structure of programming
Repetition: the for loop
COMPUTER PROGRAMMING SKILLS
Test Automation For Web-Based Applications
Topic: Loops Loops Idea While Loop Introduction to ranges For Loop
Topic: Iterative Statements – Part 2 -> for loop
Class code for pythonroom.com cchsp2cs
LOOP Basics.
Introduction to Python
Selamat Datang di “Programming Essentials in Python”
Presentation transcript:

Test Automation For Web-Based Applications Portnov Computer School WebDriver Training Test Automation For Web-Based Applications Presenter: Ellie Skobel

Python Basics Continued Day 2 Python Basics Continued

Flow Controls IF IF / ELIF / ELSE IF / ELSE Conditional assignment x = 4 if x > 0: print("yes") IF / ELSE else: print("no") IF / ELIF / ELSE x = 4 if x > 2: print("yes") elif x > 0: print("still yes") else: print("no") Conditional assignment age = 12 name = "Bob" if age > 18 else "Bobby"

For Loops Iterate through a list: Iterate x times: list_of_items = [1,2,3,4] for item in list_of_items: print('-> ' + item) Iterate x times: x = 4 for j in range(x): print('number:', x) Iterate and enumerate (count): items = ["apple", "orange"] for j, item in enumerate(items): print("item {0} is an {1}".format(j+1, item)) -> 1 -> 2 -> 3 -> 4 number: 0 number: 1 number: 2 number: 3 item 1 is an apple item 2 is an orange

print statement skipped for even numbers Loop Flow Controls break: breaks out of the smallest enclosing loop for x in range(2, 6): if 8 % x == 0: print 8, 'equals', x, '*', 8/x break continue: skips code which follows and continues with the next iteration of the loop: x = 4 for j in range(x): if j % 2 == 0: continue print j, 'is an odd number' loop stops after x=2 8 equals 2 * 4 3 is an odd number print statement skipped for even numbers

PASS statement does nothing. Loop ELSE Clause ELSE: a loop’s else clause runs when no break occurs for x in ('a', 'b', 'c', 'd'): pass else: print('loop finished') PASS statement does nothing. loop finished

Built-In Functions Built-in Functions Definition dict(iterable) Create a new dictionary enumerate(sequence, start=0) Count and iterate through the sequence eval(expression) Compiles and immediately evaluates an expression exec(expression) This statement supports dynamic execution of Python code. float(arg), int(arg), str(arg) Return a float, integer, or string constructed from the argument hasattr(object, str_arg_name) Returns true/false whether an attribute exists in an object list(iterable) Create a new list View all of the Built-in functions here: https://docs.python.org/2/library/functions.html

Built-In Functions: part 2 Definition open(name, mode=r) Open a file print(objects, sep=' ') Print objects to the stream file range(start, stop[, step]) Create lists containing arithmetic progressions reversed(seq) Return a reverse iterator. seq round(number[, ndigits]) Return the floating point value number rounded to ndigits digits sorted(iterable) Return a new sorted list from the items in iterable. zip([iterable, iterable,…]) This function returns a list of tuples (2 or more dimensional list) View all of the Built-in functions here: https://docs.python.org/2/library/functions.html