Tuesday 25 July 2017

Protractor JAVA: Writing a simple script using Jprotractor jar file

Hi All,

Hope you are doing good.

In this blog i would like to walk through to write a simple program in Java to calculate sum of  2 numbers in Angular application: 

  • ·         Create a new project in eclipse editor
  • ·         Add Selenium java client drivers to your project
  • ·         Add above created Jprotractor jar file to your project
  • ·         Create a package and create  a class
  • ·         Write a command to launch chrome driver as below: ·          

  • System.setProperty("webdriver.chrome.driver", "C:\\Users\\uname\\Downloads\\chromedriver_win32\\chromedriver.exe");
            WebDriver driver= new ChromeDriver();
    ·         Create an object to NgWebdriver a below:
    NgWebDriver nDriver= new NgWebDriver(driver);
    ·         Write webdriver commands using nDriver as shown in below code snippet: 

NgBy.Modal, NgBy.buttonText(): we have 10-12 supported methods are there which you can get detailed information from the below link only https://github.com/sergueik/jProtractor


We will see how to write few more programs using this jar file in next tutorial



Tuesday 18 July 2017

Protractor : How to use JAVA programming language for protractor

Hi All,

Hope you are doing good.

As you are aware we have to use NodeJS in writing code for protractor to automate angular JS application.

In this post i would like to give you an idea how can we write protractor code using java programming language.

We need a jar file which supports Protractor methods and we need to add that jar file to our eclipse editor which is JProtractor.

Please find the below steps to create JProtractor jar file:


  • ·         Download the code from this location as shown below: https://github.com/sergueik/jProtractor



  • ·         Unzip the downloaded folder
  • ·         Open the command prompt
  • ·         Switch to the folder exactly we have above downloaded zip file
  • ·         Remove the java folder from this location src/test/java
  • ·         mvn clean package
  • ·         it will take sometime to generate jar file
  • ·         You can find the jar file from the below location

·         C:\developer\username\jProtractor\target\jprotractor-1.2-SNAPSHOT.jar


In the next post we are going show an example how to write a program in your eclipse editor

Thanks,
Surendra Jaganadam










Tuesday 27 June 2017

APPIUM : Basic program to launch application in device and Emulator

Hi All,

In this session we discussed about how to launch the application in the real device and emulator

https://youtu.be/3qKxfjtCUuA


Thanks,
Surendra jaganadam

WebDriver: Webtable handling

Hi All,

In this session we are going to discuss about handling of webtables

https://youtu.be/3SxQ1LCJDpo


Thanks,
Surendra

WebDriver: AutoIT 3rd party tool

Hi All,

In this session we are going to discuss about AutoIT and how can we integrate with webdriver


https://www.youtube.com/watch?v=4LEh2MVE-i4&feature=youtu.be


Thanks,
Surendra

Thursday 22 June 2017

APPIUM : Desired capabilities

Hi All,

In this session we discussed about desired capabilities which we need to pass to server

Kindly have a look into below video:

https://youtu.be/rS_3JNUyn6s


Thanks,
Surendra 

Wednesday 21 June 2017

WebDriver: Multiple windows handling & Actions class concept

Hi All,

In this session we discussed about:

·         Handling Multiple Windows
·         Actions class
·         Mouse hover
·         Right click
·         Sorting

Kindly have a look into below link: 

https://youtu.be/z8nuuHFtLdI


For further details please drop me an email to surendra.jaganadam@gmail.com

Thanks,
Surendra Jaganadam

Tuesday 20 June 2017

WebDriver : Handling of frames

Hi ,

Hope you are doing good.

In this session we are going to discuss about handling of frames using webdriver.

Kindly have a look into below link:

https://www.youtube.com/watch?v=TrCtMn2YxoU

Thanks,
Surendra

APPIUM basic concepts & Eclipse configuration

HI All,

Hope you are doing good.

In this session we covered about :

Settingup a basic project
Appium API Reference

Kindly have a look into below link:

https://youtu.be/swrAYqv4Nss


Thanks,
Surendra Jaganadam
surendra.jaganadam@gmail.com

Monday 19 June 2017

APPIUM locators and creating emulator

Hi All,

In this session we are going to discuss about creating of emulators and overview on UI automater tool.


https://youtu.be/4VZZLhXcXHs

Thanks,
Surendra Jaganadam

Wednesday 14 June 2017

APPIUM: How to identify object properties- Part 1

Hi All,

In this session we will cover object identification techniques .

Kindly have a look into below video:

https://youtu.be/Dv-xi-gqHXw

Thanks,
Surendra

Monday 12 June 2017

APPIUM: Appium- Prerequisites & Installation for Windows , overview on Appium desktop version

Hi All,

Hope you are doing good.

In this session we covered about:


  • Configuration for APPIUM on windows
  • overview on APPIUM desktop version and its features
  • how to identify object properties in desktop version

Have a look into below video: 

https://www.youtube.com/watch?v=gmX_QB8SGy4&feature=youtu.be


Kindly drop us an email to surendra.jaganadam@gmail.com for any questions.


Thanks,
Surendra

Thursday 8 June 2017

WebDriver: Differences between findElement and findElements


FindElement
FindElements
Return Type
WebElement
List(java. Util) list of webElements
if the object was not there
no such element found exception comes into picture
list will return 0 element , it don’t throw any exceptions here
how it will find
In the HTML page it will search for the object with the specified property. If there are multiple objects with the same property then it will perform action on the 1st object only
This method will find all the elements in the entire webpage with the specified locators

APPIUM: Various types of mobile apps and networks

Hi All,

Hope you are doing good.

In this session we are going to study about:


  • various mobile networks
  • Different types of mobile apps 
  • Various sensors and interfaces

Kindly have  a look into below video: 

https://youtu.be/hFcEU95vtdk

In the next session we are going to study about confirmation on Windows

Thanks,
Surendra

Wednesday 7 June 2017

Jenkins: Execute testng tests from Jenkins

Steps:

Ø  Click on Build Now link
Ø  This will execute the build
Ø  Click on #1 to see the status of execution:
Ø  Below screen will display :
Ø  Click on console output to see details about the success r failure.

Jenkins: Create TESTNG batch file for JENKINS

Steps :

·         Create a JAVA project and add selenium libraries to that project

Create a testng test case and write basic program
·         Create testng xml file and call above test case
Project hierarchy:
·         Open notepad
·          
·         Paste below code into the notepad:
set projectLocation=C:\Projects\Sample
cd %projectLocation%
set classpath=%projectLocation%\bin;%projectLocation%\lib\*
java org.testng.TestNG %projectLocation%\testng.xml
·         Give unique name.bat  as below
·         Once it got created it will display as below
·         We need to create this file within the project location

Add testng tests to Jenkins:

Steps:
1.      Once after we successfully logged into Jenkins using http://localhost:8080 you can see below screen


1.                                                       2. Click on create new jobs
3.      Give  a name and select “Free style project” as below

4.      Hit ok button at the botton 

                           5.      Click on advanced
                           6.      Select use custom workspace checkbox

                           7.      Enter project location to the text field as below: 
                          8.      Click on add build steps from build options 
                          9.      Select “Execute window batch command” 
                           10.      Specify the batch which we created for testng and specify the name of that file here. 

                              11.      Click on save button below screen will display









Jenkins: What is Jenkins and its installation steps

What is Jenkins?
Jenkins is an leading open source continuous integration server built with Java developed by Hudson lab. It is cross-platform and can be used on Windows, Linux, Mac OS and Solaris environments.
Specifically for a test only project, it is used to schedule jobs for regression testing without manual intervention and hence monitor infrastructural and functional health of a application. It can be used like a scheduler for integration testing and also can be used to validate new deployments/environments on a single click on a Build now button .

Advantages :
·         Jenkins is an open source tool with much support from its community.
·         Installation is easier.
·         It has more than 1000 plug-in to make the work easier.
·         It is easy to create new Jenkins plugin if one is not available.
·         It is a tool which is written in Java. Hence it can be portable to almost all major platforms.


Installation:
1.      Download Jenkins.war file from this link





2.      Copy the downloaded file and paste it in C Drive
3.      Open the command prompt and change directory to where the “Jenkins.war” copied using cd..
4.      In my case I kept my .war in C drive hence after opening the command prompt I am tying cd.. for 2 times to navigate to C drive where .war was copied
5.      Type  java –jar Jenkins.war and hit enter button



1.      Below message will display :



1.      Once Jenkins is up and running then in the browser open this URL : http://localhost:8080
2.      When we open above URL it will ask password by specifying a location , goto that location and the get the security key and update it in password and click on next button
3.      Below screen will display after successful login :







Tuesday 6 June 2017

APPIUM: Introduction to mobile testing and overview on mobile devices

Hi All,

Hope you are doing good.

In this session we discussed about :


  1. User expectation on mobile app's
  2. points we need to remember while testing mobile app's
  3. various mobile devices and OS's
  4. How to identify a right device
  5. Mobile testing facts

Kindly have a look into below link : 


Kindly drop us an email to surendra.jaganadam@gmail.com for running notes.

Thanks,
Surendra

Friday 2 June 2017

APPIUM Limitations

HI All,

Good Morning.

In this post i would like to discuss about limitations of Appium.

https://youtu.be/C3vjHfM0Qug

Kindly have a look into this video and let me know if you have any questions

Thanks,
Surendra

APPIUM architecture overview

Hi All,

Hope you are doing good.

In this session i would like to give you an overview on APPIUM which covers :


  • What is Appium
  • Advantages
  • Architecture
Kindly have a look into below video:


https://youtu.be/fcn6bNTY2Bg

Let us know if you need any further information from myend

Thanks,
Surendra Jaganadam

Tuesday 4 April 2017

Protractor: Basic scripts

Basic Scripts:
Protractor needs two files to run, the test or spec file, and the configuration file. 

How to create scripts:
·         Create a folder
·         Create 2 text files name them as conf.js and spec.js
·         Lets see significance of conf and spec files below with simple examples
·         Copy paste below codes into spec and conf files as given below and save them

Spec files

Protractor tests are written using the syntax of your test framework, for example Jasmine, and the Protractor API. We are going to write code with Jasmine framework.

Example Spec File

This simple script (example_spec.js) tests the 'The Basics' example on the angularjs.org homepage.
describe('angularjs homepage', function() {
  it('should greet the named user', function() {
    // Load the AngularJS homepage.
    browser.get('http://www.angularjs.org');
expect(browser.getTitle()).toEqual(AngularJS  Superheroic JavaScript MVW Framework');
 
 
});
});
 

Global Variables

Protractor exports these global variables to your spec (test) file:
·         browser - A wrapper around an instance of WebDriver, used for navigation and page-wide information. The browser.get method loads a page. Protractor expects Angular to be present on a page, so it will throw an error if the page it is attempting to load does not contain the Angular library. (If you need to interact with a non-Angular page, you may access the wrapped webdriver instance directly with browser.driver).
·         element - A helper function for finding and interacting with DOM elements on the page you are testing. The elementfunction searches for an element on the page. It requires one parameter, a locator strategy for locating the element. See Using Locators for more information. See Protractor's findelements test suite (elements_spec.js) for more examples.
·         by - A collection of element locator strategies. For example, elements can be found by CSS selector, by ID, or by the attribute they are bound to with ng-model. See Using Locators.
·         protractor - The Protractor namespace which wraps the WebDriver namespace. Contains static variables and classes, such as protractor.Key which enumerates the codes for special keyboard signals.

Config Files

The configuration file tells Protractor how to set up the Selenium Server, which tests to run, how to set up the browsers, and which test framework to use. The configuration file can also include one or more global settings.

Example Config File

A simple configuration (conf.js) is shown below.
// An example configuration file
exports.config = {
  // The address of a running selenium server.
  seleniumAddress: 'http://localhost:4444/wd/hub',
 
  // Capabilities to be passed to the webdriver instance.
  capabilities: {
    'browserName': 'chrome'
  },
 
  // Spec patterns are relative to the configuration file location passed
  // to protractor (in this example conf.js).
  // They may include glob patterns.
  specs: ['example-spec.js'],
 
  // Options to be passed to Jasmine-node.
  jasmineNodeOpts: {
    showColors: true, // Use colors in the command line report.
  }
};
 
 
Script execution: 
·         Open command prompt
·         Enter webdriver-manager update and hit enter button , below screen will display
·         

·         Enter webdriver-manager start and hit enter button , below screen will display

·         Open new command prompt
·         Move to the folder where we created spec.js and conf.js files using cd file location
·         Enter protractor conf.js and press enter button

·         Browser will be launched and script will execute on the browser.

Protractor: Introduction to Jasmine and support browser for protractor

What is Jasmine:
Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend on any other JavaScript frameworks. It does not require a DOM. And it has a clean, obvious syntax so that you can easily write tests. This guide is running against Jasmine version 2.1.0.
 Test suite begins with a call to the global Jasmine function describe(as shown below code snippet) with two parameters: a string and a function. The string is a name or title for a spec suite - usually what is being tested. The function is a block of code that implements the suite.
describe("A suite", function() {
  it("contains spec with an expectation", function() {
    expect(true).toBe(true);
  });
});
Specs are defined by calling the global Jasmine function it, which, like describe takes a string and a function. The string is the title of the spec and the function is the spec, or test. A spec contains one or more expectations that test the state of the code. An expectation in Jasmine is an assertion that is either true or false. A spec with all true expectations is a passing spec. A spec with one or more false expectations is a failing spec

It's Just Functions

Since describe and it blocks are functions, they can contain any executable code necessary to implement the test. JavaScript scoping rules apply, so variables declared in a describe are available to any it block inside the suite.

Browser Support:

Protractor supports the two latest major versions of Chrome, Firefox, Safari, and IE. These are used in Protractor's own suite of tests.
Note that because Protractor uses WebDriver to drive browsers, any issues with WebDriver implementations (such as FireFoxDriver, ChromeDriver, and IEDriver) will show up in Protractor.