Python Programming – Operators and data types
The most important foundation level in python is understanding topics like Statements, keywords, Identifiers, Operators, datatypes, methods, class, objects, etc..
Let's see the concepts below on the Operators to begin with,
2 variables A and B, with A =5 and B=10
Arithmetic -> Addition +, Subtraction, -, Multiplication *, Division /, Modulo%, Floor Division //, Floor Multiplication **
A+B ->5+10=15
A-B=5-10 = -5
Conditional operators - lesser than<, Greater than>, less than or equal to<=, Greater than or equal to >=, Not equal to !=, Equal to ==
Boolean data types - TRUE, FALSE
Logical Operators - AND OR NOT
Membership Operators - IN, NOT
Identity Operators - IS, IS NOT
Appium – Mobile App Automation – Introduction
If not available, download the node.js from the official website, Download | Node.js (nodejs.org)
now in command prompt type node -v or npm -v for checking on the versions of node and npm(node package manager)
The node and npm is installed successfully in the machine.
to see the location of the installed npm and node
npm where
node where
install appium
npm install -g appium
To verify Appium installation
appium --version or appium -v
to start appium just type in the command prompt as appium
to stop ctrl+c and the appium server will shutdown
Install appium with appium desktop client based ont eh OS u are using select the necessary package and install.
To start the server, click start
APPIUM Doctor -GitHub - appium/appium-doctor: Tool to verify appium installation
- is the next to be installed. npm install appium-doctor
to check if appium-doctor is installed, use appium-doctor --version
to check for android
appium-doctor --android
https://www.browserstack.com/guide/appium-with-python-for-app-testing
Java – Object Oriented Programming – Polymorphism
//Polymorphism //Compile time polymorphism //object overloading //different in data types and diff number of arguments public class Calculator { public static void main(String[]args) { Calculator calc =new Calculator(); calc.add(10, 20); calc.add(10, 20, 30); calc.add(10, 20, 30.5f); } public void add(int a1, int a2) { System.out.println(a1+a2); } public void add(int a1, int a2, int a3) { System.out.println(a1+a2+a3); } public void add(int a1, int a2, float a3) { System.out.println(a1+a2+a3); } }
// object overriding //run time polymorphism public class Scicalc extends Calculator { public static void main (String[]args) { Scicalc scicalc = new Scicalc(); scicalc.add(100, 100); } //intentional addition of the below method to override the parents method add public void add(int a1, int a2) { if (a1>100 && a2 >100) { System.out.println(a1+a2); } else { System.out.println("Please enter numbers greater than 100"); } } }Example 2:
//if class made as final, it cannot be inherited, remove the final in the next line to be inherited by child class. public final class Parent3 { //final keyword is to make sure the //variable is not updated in the child class //child class uses only the parent class //value and is not overridden final int pocket_money =5; public static void main(String[]args) { Parent3 parent3 =new Parent3(); parent3.watchTV(); } public final void watchTV() { System.out.println("LG"); } }Below is child class
//method overriding //dynamic binding //run time polymophism - on an inheritance //code public class Child3 extends Parent3 { public static void main (String[]args) { //regular mode of creating an obj in parent class //Parent3 parent3 = new Parent3(); //Parent object reference for a child object // parent obj ref can only call method of a //child class which is also in the parent //class Parent3 parent3 = new Child3(); parent3.watchTV(); //parent3.coding(); //Child3 child3 = new Child3(); //child3.watchTV(); //new Child3().watchTV(); System.out.println(parent3.pocket_money); //to check the value cannot be assigned to alreay declared final //parent3.pocket_money=10; } //public void watchTV() //{ //System.out.println("Smart TV"); //} public void coding() { System.out.println("coding"); } }
Collection
First let's see the collections advantages over array
- Continuous memory
- Unused memory will be wasted
- cannot say the array size upfront
Collection is basically called a collection of objects Interfaces - all are contracts
- Set - ex: playing cards - no order is maintained- no duplicate elements are present
- List - ex: Grocery list - insertion order- can have duplicates!
- Map
JavaScript
basics to see, how JavaScript works
Open Browser-> Console-> see basics of JavaScript
Comments in java script is given by //
//This is a comment
Basic data types
All the below are considered as numbers
integers-> 10
floating point-decimal ->12.0
negative numbers-13.5
String -> Ex:1 "hello World" Ex:2 "12"
Boolean -> true , false
undefined and null are basic data types in java script
clear () - used to clear console
Apache JMeter Introduction – Basic tests
Apache JMeter is an Apache project used to in load test, to evaluate the performance of the applications. Let's get started in few simple steps in creating a simple test to understand the basic features of JMeter. Accessing JMeter -the package can be downloaded from the Apache JMeter - Download Apache JMeter website and extracted, saved in the preferred location from where it could be used. The necessary pre-requisite is provided on the website. Open the tool in windows OS by navigating to the path and double clicking the batch file, once the tool is opened Navigate to file->new->Test Plan add necessary info and save the file. Once the Test Plan is created, Right click on the test plan and create a thread Group defining the total number of users, ramp-up time, etc.. to be used in the test. Adding the users- ramping up and ramping down, here the users are10 and minutes to ramp-up (steadily increase the user count/simulation to do the similar actions) in the 20 seconds.
Adding listeners to see the results, here we are seeing 2 listeners View results tree and View Results in table, once the test plan is run the below information can be seen. View Results Tree View Results in Table
New Test Plan creation in Apache JMeter
Adding Samplers
Notes:
- Create a test plan
- View results
- Results tree
- Results in table
- Assertion
- Timer
- Listener
- Thread Group
- Ramp up
- Ramp down
- Heap dump
- Enable Debug
- HTML Report Viewer
- Log Level
- Trace
- Log Level
- Start->Remote->Stop+All
- Test/Sampler-> FTP,HTTP, JDBC, API
- View results
Python – Automation – P1- Install robotframework
Robot framework.org - python based framework - keyword driven approach!
Ex:
open browser url chrome
input text id text info
Close Browser
install on windows OS
1.As a pre-requisite python must be installed in the system you are going to create the automation scripts, once its installed
need to check if pip is available
2. pip install robotframework
3. pip install --upgrade robotframework
4. pip install robotframework==5.0.1
to check if the robot framework is correctly installed, please follow the below commands!
pip freeze
pip list
pip show robotframework
pip check robotframework
If you want to uninstall Robot framework
To check on the version of the Robot framework
robot --version
Set environment variables in the PATH, so python is accessible from across locations in the system from where the code/file is being saved.
Java – Selenium – Web Automation Introduction
Selenium can be considered either as API or a framework, a tool to automate web applications. It is open source and can be programmed in multiple high-level languages.
Ex: Python, Java, C#, etc...
Here, we are going to see the usage of the tool in Java. A foundation level of understanding of the core concepts and object-oriented programming is necessary.
To validate the UI scenarios using Java and Selenium, one can use the jQuery website to practice with the latest UI level usage across the website.
Automation Framework – POM – Page Object Model
Approach used in Automation framework,
For each page we have a separate class/object ?
Lets See on the General understanding of the few of the topics
object - instance of class
classes - collections of states and behaviours
methods (functions) - logic used for the computation
Return statements - print?
arguments - variables used in methods for the computations
-- Each page has a class. separate file
-- test data can be picked form the excel sheet's specified tab.
-- utility classes - has the details of the excel sheet, tab etc..