Where we learn technology

Month: January 2018

How Much Java you need to learn for a good Selenium Scripting ?

How Much Java you need to learn for a good Selenium Scripting ?

As far as Selenium is concerned we have our SeleniumHQ Site with frequently updated documentation we can go through that to get the selenium concepts much strong also there are many blogs on selenium wherein you can get to learn from the basics even this blog is one among that, when considering the Language based client drivers if you use Java then here are some Java topics that you need to know for a better understanding and good selenium scripting.
    OOP’s concept – Class, Objects Polymorphism, Inheritance and Encapsulation
    Java Programming essentials– Object Instances, method overloading/overriding concepts and packages
    Control Statements – While, do-While, Switch, If statements – This will help us in writing the scripts for a multiple scenario statements and decision making scenarios.
    Looping statements – This will help us in scenarios like, iterating through a large table to find a record that you want and Running the same test for multiple number of times.
    Arrays Concepts – This will help us in having some set of datas of same type in a static way.
    Threads and MultiThreading Concepts – This will help us in making run our scripts in different threads that will help us in achieving better performance.
    Java Collections Framework – ArrayLists and HashMaps – This will help us in maintaining a collection of data’s. Particularly useful for scenarios where you need to compare the data from Web app UI with the DB. [OR] From UI to another UI
    File Streams – This will be helpful in externalization of data through CSV, Excel or Java Properties file.
    The above mentioned topics in java is will make you a pretty good selenium coder :). I will try to cover all these concepts with some real time examples. Until then please go through the Java concepts, there are many java tutorials on my YouTube channel:
    Naveen AutomationLabs
    Please follow and like us:

    Why world is moving towards open source automation tools

    Why world is moving towards open source automation tools

    • Cost effective but matured solution: As the market growth has pushed up the overall expense for testing tools,
    •  it is directing IT organizations towards less expensive open source testing tools which offer the same 
    • functionality. With low licensing costs and fairly minimal hardware requirements, organizations get 
    • the extra benefit of flexible pricing plans as per the use of specific cloud storage.
    • Flexibility as per business strategy: As the open source tool can be altered as per particular requirement 
    • it reduces dependencies, unlike traditional tools. For example in Jira, the tester may include specific java 
    • code for some test scenarios. This promotes faster time around time of testing and resulting quick promote 
    • of the deliverables.
    • Open source community support and collaboration: It is easier to seek guidance and help from open
    •  source community. It is a centralized collaboration across the globe with the specific strategy and attention
    •  to contribute to the community.
    • Fast and frequent testing: As the automated test cases are short, those run faster and frequently as 
    • programmed by the testers. Hence, it is a very effective solution to find the bugs when you are testing 
    • your software in an agile environment with changing requirements. You can continuously add new test cases 
    • over the time to existing automation while development is on the go.
    • The paradigm shift: The software industry is facing the continuous threat of recession which ultimately 
    • has tightened the organizational budget. As open source tools are easy to learn and even a programmer 
    • can also work as a tester, organizations are stressing on their existing resources to learn it rather than 
    • hiring traditional testers.
    • Enable Agile testing: The traditional model of testing lifecycle follows “V” model. However, organizations 
    • now have recognized promising success by using open source tools in the Agile development environment. 
    • These tools significantly help in enabling early unit tests and also integration mechanisms which are very 
    • effective for time-sensitive Agile projects.
    • Freedom with greater security: Using open source automation tools frees organizations from vendor-specific 
    • restrictions like their availability for support, usage rules and much more. With open source tools, 
    • the user can make the decisions themselves and have the freedom to enhance the overall execution 
    • speed of the testing process. Also, in terms of security, open-source software is definitely superior to 
    • traditional frameworks.
    • Leverage cross platform and cross language testing: One of the major criteria of your testing tool 
    • must be its cross-platform and cross-browser support as  today’s applications are mostly run on mobile 
    • devices. Open source tools like Selenium, Appeium supports these features covering any kind of mobile 
    • app whether it is native, web-based or hybrid.

    In today’s fast-moving demanding world, it is a challenge for any software company to sustain 
    at the same performance level with constant quality and efficiency. The major challenges here 
    are time and cost and of course market competitors. Hence to sustain your business, whether 
    it is a product or service, quality delivery with optimized cost is the only solution. Otherwise,
     it leads you to customer dissatisfaction, and ultimately you will end up with bad market 
    reputation. And when you are in the software business, testing is the key to assure the quality.

    Over the past decade, the software industry has witnessed the revolutionary change in 
    the software testing and QA domain with the boom of automation testing. As the automation 
    testing has the ability to hit the core bottleneck areas of traditional manual testing, like poor
    test strategy, delay in testing, enhanced cost due to wrong effort estimation etc, companies are 
    leaning towards it. Moreover, with the upcoming open source automation tools like Selenium, 
    Appium, JUnit and much more, the trend is following this path with a rapid pace. 
    Even most of the renowned software companies are enforcing their employees to learn these tools.

    A number of industry-standard open source automation testing tools is now available 
    to fit with different stages of the testing process, from unit testing to complex user testing. 
    Open source tools have become an integral part of the IT spectrum in nearly every area of 
    software testing domain. Here is a bar chart for a rough overview of these tools in terms of 
    trending popularity across the globe –
    Mostly used open-source automation tool

    Mostly used open-source automation tool
    Advantages those drive business to select Open Source Automation tools 
    A real-time case study of an entertainment site by a market leading software company shows 
    how open source testing accelerated testing:
    Real-time example of automation

    Real-time example of automation
    Although open source tools can drive significant quality and predictability in the testing life cycle,
    proper approaches must be taken care before using it. Every app is different, hence proper feasibility 
    study and pilot implementation are required before stepping into a live experiment. In some cases, 
    open source and commercial testing tools are blended together to get the overall better outcome and testing reliability.
    Please follow and like us:

    Locator Strategies in Selenium WebDriver

    Locator Strategies in Selenium WebDriver


    Now a days Selenium is vastly used as web automation tool across industry. It has its own advantages whether it might be an open source tool or freedom of scripting language. Selenium WebDriver mimics the actual user operations, so it gives the actual user experience while execution.
    Selenium have wide range of locators which helps to locate elements on a web page.
    Today we will talk about them.

    Selenium Locators

    Selenium gives user options to locate elements in 9 different ways.
    • Id
    • Name
    • Linktext
    • Partial Linktext
    • Tag Name
    • Class Name
    • CSS (Cascaded Spread Sheets)
    • XPath (XML path)
    • DOM (Data object modeling) (Not supported by WebDriver)
    The sequence of the operator shows how much your script is going to be efficient while execution. To elaborate this lets take one example.
    We will try to locate field User ID by Id and XPath.
    Locator by id : Id= txtUserName Locator by xpath : XPath= //input[@id=’txtUserName’]
    (xpath might have different combination we will see them in xpath section.)
    If we execute script using both locators, to locate the field using Id will take less time compared to Xpath. In this way we will able to increase the efficiency of script by reducing execution time.
    Now we will see all locators in detail.

    Selenium Locators: Locate element by Id

    The most preferred, the easiest and efficient way to locate an element on a web page is By ID. Id will the attribute on the page which will be unique like you bank account number or employee id. Ids are the safest and fastest locator option and should always be the first choice even when there are multiple choices.
     Example 1:  <input id="txtUserName" type="text">
     Example 2:  <input id="txtUserName" name="userName" type="text">
    In first example its straight forward we only have Id, but in second we have Id as well as Name as an attribute. We can write the script as
     WebElement Ele = driver.findElement(By.id("txtUserName "));
    But in many cases we found that we have common Id or dynamic Ids (like in case of google, Gmail or the application using GWT). In that case we need to use different locators.

    Selenium Locators: Locate element by Name

    This is a fall back option when Id for element is not present. But mostly the names are used again and again, so make sure that the name is unique on the page before using it.
    <input id="txtUserName" name="userName" type="text">
    WebElement ele= driver.findElement(By.name("userName "));

    Selenium Locators: Locate element by LinkText

    Finding an element with link text is very simple. This locator is used in case you want to locate any hyperlink only. But make sure, there is only one unique link on the web page. If there are multiple links with the same link, in such cases Selenium will perform action on the first matching element with link on page.
    In above image we have three hyperlinks. If we want to locate the Forgot Password? Link. The locator will be
    <a href="#">Forgot Password? </a>
    WebElement hyperlink = driver.findElement(By.linkText("Forgot Password?"));
    We have 2 links with text Forgot Email. If we try to locate 2nd link with locator
    LinkText=*Forgot Email. Selenium will locate 1st link.
    In this case if we want to locate the 2nd link, we will need to use exact keyword with colon (exact:). The locator in that case will be
    linkText= exact:*Forgot Email
    <a style="background-color: transparent;" href="#">*Forgot Email</a>
    WebElement hyperlink = driver.findElement(By.linkText("exact:*Forgot Email"));

    Selenium Locators: Locate element by Partial LinkText

    Partial LinkText works same as LinkText, only difference is you can use a part of the text from link.
    <a href="#">Forgot Password? </a>
    WebElement hyperlink = driver.findElement(By. PartialLinkText ("Password"));

    Selenium Locators: Locate element by Tag Name

    Tag Name we can use for the elements like drop downs, check boxed, radio buttons. Following html is for drop down with 3 values. To select that drop down we will use tagName locator.
    <select name="selCity" id="selCity">
    <option value="none">--Select--</option>
    <option value="PUNE">Pune</option>
    <option value="ADI">Ahmedabad</option>
    WebDriver command:
    Select select = new Select(driver.findElement(By.tagName("select")));

    Selenium Locators: Locate element by Class Name

    This locator we can use as a fall back option for either name or Id. But the same condition applied here Class name should be unique or selenium will locate the first element present on the page with the class name we have used to locate element.
    <input id="txtName" class="textboxcss" tabindex="1" type="text">
    WebElement classtest =driver.findElement(By.className(“textboxcss”));

    Selenium Locators: Locate element by CSS selector using html tag attributes

    This a fall back when all options fail, you can use parent child relation in tags, in case you need to use complex strategy to locate elements. CSS selectors are string representation of HTML tags, attributes, Id, Class. It’s somewhat complex strategy compared to the previous we seen. But we can locate the elements which don’t have even Id or name or class using CSS selectors.
    We can use different combinations of attributes to locate an element using CSS selector.
    • Tag and ID
    • Tag and class
    • Tag and attribute
    • Tag, Id and attribute
    • Tag, class, and attribute
    • nth-child()
    • Inner text (Not supported by WebDriver)
    These are commonly used combinations, for more combinations you can refer this
    URL: http://www.w3schools.com/cssref/css_selectors.asp
    But you need to check first that the combination you are going to use is supported by Selenium WebDriver.

    Tag and ID

    In this case you need to follow this syntax css=tag#id. For Id we need to use sign before id value.
    <input id="txtName" class="textboxcss" tabindex="1" type="text">
    WebElement cssele = driver.findElements(By.cssSelector("input#txtName"));
    Here input is tag name and Id is txtName with # sign.

    Tag and Class

    In this case you need to follow this syntax css=tag.classname. For class we need to use dotbefore class value. If there is space between classname like classname you need to use dot in between space.
    Example 1:
    <input id="txtName" class="textboxcss" tabindex="1" type="text">
    WebElement cssele = driver.findElements(By.cssSelector("input.textboxcss"));
    Example 2:
    <input id="txtName" class="textboxcss top" tabindex="1" type="text">
    WebElement cssele = driver.findElements(By.cssSelector("input.textboxcss.top"));
    Here input is tag name followed by dot and class name textboxcss. In example 2 class name is
    textboxcss<space>top in that case we put dot in between textboxcss and top.

    Tag and Attribute

    In this case when we don’t have both Id or class name we go for html attributes given in tags.
    Syntax for this combination is css=tag[attribute=’value’]. We need to use square brackets to specify the attribute and its value. Put the value between single quotes when you are writing script in Java.
    <input value="Reading" type="checkbox">
    Here in first case type is attribute and checkbox is its value, in other case value is an attribute and its value is Reading.

    Tag, ID and Attribute

    In this case when we have common id but other attributes are different, we go with this combination. Syntax for this combination is css=tag#id[attribute=’value’].
    <input id="txtName" class="textboxcss" tabindex="1" name="taComment" type="text">
    <input id="txtName" class="textboxcss" tabindex="1" name="tbComment" type="text">
    WebElement cssele = driver.findElements(By.cssSelector("input#txtName[name=’taComment’]"));
    Here for both textboxes id is same ever class name is also same, only name is different for both. So if we want to locate first text box we will go with locator given in above example. For second text box we need to change value of name attribute in same combination.

    Tag, Class and Attribute

    In this case when we have id but we have class name which is common around other elements but other attributes are different, we go with this combination. Syntax for this combination is css=tag.classname[attribute=’value’].
    <input class="textboxcss" tabindex="1" name="taComment" type="text">
    <input class="textboxcss" tabindex="1" name="tbComment" type="text">
    css=input.textboxcss [name=’taComment’]
    WebElement cssele = driver.findElements(By.cssSelector("input.textboxcss [name=’taComment’]"));


    In this case we have same Id or class name and other attributes for different elements, we can go with nth-child().
    Syntax for this combination is css=tag:nth-child(n). Here in syntax we can use any combination discussed above. With that we need to use: nth-child(n). n represent child number.
     css= li:nth-child(n)
    WebElement cssele = driver.findElements(By.cssSelector("li:nth-child(n)"));
    Here if we can see the ul li parent child structure. We have only tag names which are common to everyone. Here if we want to locate sat Java we will put n=4 in above command.

    Inner text

    This is right now not supported by WebDriver in case of CSS, but most probably will support in upcoming Selenium 3 or 4.
    Syntax: css= tag:contains(‘inner text’), Here in syntax we can use any combination discussed above. With that we need to use (:) contains(inner text).
    <span>Upload you pic :</span>
      css= span:contains(‘Upload you pic ‘)
    WebElement cssele = driver.findElements(By.cssSelector("span:contains(‘Upload you pic‘)"));

    Absolute and Relative Path

    The Examples we have seen till now are related to only single tag and its attribute. But when we require to build path using parent child relation we need to give its either absolute or relative path.
    Consider here we want to locate Python using parent child relation. In that case relative path will be
    Relative path: css=div<space>ul<space>li:nth-child(3) or css=div<space>li:nth-child(3). In second combination we have removed ul. Space denotes it’s a Relative path. Here WebDriver will search 3rd li inside given div and ul.
    And if we want Absolute path for same, it will be
    Absolute path: css= div>ul >li:nth-child(3) or css=ul> li:nth-child(3). Here angular bracket denotes Absolute path. It’s an exact path for given element.
    To know the difference between both let’s consider the example.
    Someone asked you where is your office? Most common answer is Hinjewadi. But if a courier boy asked you the address you will tell full and exact address of your office. 1st one is relative path to your office but 2nd is absolute one.
    Please follow and like us:

    Security Testing Test Scenarios – By Naveen AutomationLabs

    Security Testing Test Scenarios – By Naveen AutomationLabs

    1. Check for SQL injection attacks

    2. Secure pages should use HTTPS protocol

    3. Page crash should not reveal application or server info. Error page should be displayed for this

    4. Escape special characters in input

    5. Error messages should not reveal any sensitive information

    6. All credentials should be transferred over an encrypted channel

    7. Test password security and password policy enforcement

    8. Check application logout functionality

    9. Check for Brute Force Attacks

    10. Cookie information should be stored in encrypted format only

    11. Check session cookie duration and session termination after timeout or logout

    11. Session tokens should be transmitted over secured channel

    13. Password should not be stored in cookies

    14. Test for Denial of Service attacks

    15. Test for memory leakage

    16. Test unauthorised application access by manipulating variable values in browser address bar

    17. Test file extension handing so that exe files are not uploaded and executed on server

    18. Sensitive fields like passwords and credit card information should not have auto complete 

    19. File upload functionality should use file type restrictions and also anti-virus for scanning uploaded files

    20. Check if directory listing is prohibited

    21. Password and other sensitive fields should be masked while typing

    22. Check if forgot password functionality is secured with features like temporary password expiry after specified hours and security question is asked before changing or requesting new password

    23. Verify CAPTCHA functionality

    24. Check if important events are logged in log files

    25. Check if access privileges are implemented correctly

    ~~~Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:

    Follow me on my Facebook Page:

    Let’s join our Automation community for some amazing knowledge sharing and group discussion:
    Please follow and like us:

    Database Testing Test Cases – By Naveen AutomationLabs

    Database Testing Test Cases 

    1. Check if correct data is getting saved in database upon successful page submit

    2. Check values for columns which are not accepting null values

    3. Check for data integrity. Data should be stored in single or multiple tables based on design

    4. Index names should be given as per the standards e.g. IND_<Tablename>_<ColumnName>

    5. Tables should have primary key column

    6. Table columns should have description information available (except for audit columns like created date, created by etc.)

    7. For every database add/update operation log should be added

    8. Required table indexes should be created

    9. Check if data is committed to database only when the operation is successfully completed

    10. Data should be rolled back in case of failed transactions

    11. Database name should be given as per the application type i.e. test, UAT, sandbox, live (though this is not a standard it is helpful for database maintenance)

    12. Database logical names should be given according to database name (again this is not standard but helpful for DB maintenance)

    13. Stored procedures should not be named with prefix “sp_”

    14. Check is values for table audit columns (like createddate, createdby, updatedate, updatedby, isdeleted, deleteddate, deletedby etc.) are populated properly

    15. Check if input data is not truncated while saving. Field length shown to user on page and in database schema should be same

    16. Check numeric fields with minimum, maximum, and float values

    17. Check numeric fields with negative values (for both acceptance and non-acceptance)

    18. Check if radio button and dropdown list options are saved correctly in database

    19. Check if database fields are designed with correct data type and data length

    20. Check if all table constraints like Primary key, Foreign key etc. are implemented correctly

    21. Test stored procedures and triggers with sample input data

    22. Input field leading and trailing spaces should be truncated before committing data to database

    23. Null values should not be allowed for Primary key column

    ~~~Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:


    Follow me on my Facebook Page:

    Let’s join our Automation community for some amazing knowledge sharing and group discussion:


    Please follow and like us:

    API/WebServices – Back End Manual & Automation – Regular Batch – (31st Oct 2019)

    WebServices – Back End API Manual & Automation Training Course Content

    Next Batch Starting from: 31st Oct, 2019 (Thursday)

    Duration: 5-6 Weeks

    Location: Online

    • 9:30 PM IST (Indian Time)
    • 12 PM EST (Eastern Time)
    • 9 AM PST (Pacific Time)
    • 5 PM UK TIME
    Registration Fee: 3000 INR (50 USD)

    Course Fee
    • 16500 INR (For Candidates in India)
    • 300 USD (For Candidates in US/UK/NZ/AUS/Europe)

    • There will be 2 demo sessions. If you don’t like the sessions or if you want to leave. Full Registration amount will be refunded back to you.
    • After 2 demo sessions, pending amount (13500 INR/250 USD) must be paid.
    • Only for old API students: If you want to rejoin this batch, you need to pay 3000 INR/50 USD registration fee, No need to pay full fee.
    • For any query, whats app me at: +91-9902233400.

    ~~~ For more information, please refer this course content: Please fill your details here:

    Here I’m sharing the bank account details. Please send me the receipt once you make the payment without fail.

    Please find below bank details: You can make the transaction directly to the given account or make it via Western Union.

    Bank Details:
    To Account
    Bank Name
    Branch Location

    IFSC Code: UTIB0000256     

    For Candidates in India:
    You can make the payment via Tez (Google PAY) UPI also to this number: +91-9902233400. UPI: naveenanimation20@okicici OR Google IDnaveenanimation20@gmail.com

    Syllabus Course Content:

    Manual Testing of WebServices/API:

    1. Introduction of API and WebServices:
      1. What is API
      2. What is WebService
      3. What is Backend Architecture
      4. Rest vs SOAP APIs
      5. What is CRUD operation
      6. What are different HTTP Calls – GET/POST/PUT/Delete
      7. Different Live Projects Examples
    2. Postman:
      1. Introduction
      2. How to call Rest API in Postman
      3. How to pass path parameter in Request
      4. How to pass query parameter in Request
      5. How to set Headers in Postman
      6. How to pass JSON/XML Payload
      7. How to check response status code
      8. How to check JSON/XML response message
      9. What is response header
      10. Cookies manipulation
      11. Header Presets
      12. API History in Postman
    3. Advance Postman/Newman:
      1. Introduction of Newman
      2. Newman installation/setup
      3. How to run collections from Newman
      4. Newman command line options
      5. Generate HTML Test Report
      6. Create a collection and folders
      7. maintenance of API collections
      8. Postman Console and logs
      9. Test Script in postman
      10. Pre Request Script in postman
      11. Test Code snippet in postman
      12. Monitoring of APIs
      13. API Documentation
      14. API Documentation in different programming languages
      15. Publish Documentation
      16. Setup Environment – Local and Global
      17. Collection Runner
      18. Collection Test Summary
      19. Creating a Mock Server for APIs
      20. How to create a team workspace
      21. How to create individual workspace
      22. Import in Postman
      23. Basic and Advanced Settings in Rest Client
      24. Running postman collection with Docker
      25. Running postman collection with Jenkins
    4. How to check APIs at the network layer using developer tools of browser:
      1. How to check Backend services – APIs running behind
      2. What is developer tool in Chrome
      3. How to check request/response of any API in Firefox/Chrome browsers
    5. What are different HTTP Status Response Codes:
      1. 100 series
      2. 200 series
      3. 300 series
      4. 400 series
      5. 500 series

    Automation Testing of Back End/APIs:

    1. Learn HTTP Client API:
      1.  All CRUD – GET/POST/PUT/Delete Calls
      2. How to send Request with Payloads
      3. What is JSON Payload
      4. How to validate JSON response using JSON Parsers
      5. How to do Basic Auth with HTTP Client
      6. How to do OAuth with Http Client
    1. Learn Rest Assured Client API:
      1. Introduction of Rest Assured
      2. Rest Assured methods: GET/POST/PUT/Delete
      3. Handle different payloads using POJO and JSON/XMLs
      4. Handle Authentication using Basic Auth, Digest Auth, Preemptive Auth, Bearer Token, Authorization Token, OAuth1 and OAuth2
      5. All core features of Rest Assured Library:
        1. GET/POST/PUT/DELETE – BDD Approaches
          1. What is GIVEN/WHEN/THEN/AND methods
          2. What is LOG and ALL methods
          3. How to ASSERT in Rest Assured
          4. How to verify Status Code, Response Body and Headers
          5. How to use QUERY PARAMETERS and PATH PARAMETERS
          6. What is ResponseBuilderSpec and RequestSpecification Concept
          7. What is JSON PATH
          8. What is EXTRACT method
          9. How to send a POST CALL with JSON String, JSON File and using Java (POJO) Class.
          10. What is Serialization and De-Serialization
          11. How to use HAMCREST – Assertion Library
        2. GET/POST/PUT/DELETE – NON-BDD Approaches
      6. New End to End Framework using Rest Assured
      7. Reporting : Extent Report/TestNG Report/Allure Report

    1. API functional Testing using Jmeter Tool (only functional part)
      • Download and Installation of Jmeter
      • How to test APIs using Jmeter
      • Request and Response handling in Jmeter
         9. Basics of SOAP UI Tool
      • Download and Installation of SOAP UI tool
      • How to create a Project in SOAP UI
      • How to create a Test Suite in SOAP UI
      • How to create different Test Cases in SOAP UI
      • Different Assertions in SOAP UI

    10. Maven: Build Automation Tool
      • Run your API Automation Framework from Maven
      • Different commands in Maven

    11. TestNG (TDD) Framework for API automation

    12. GIT Repo:

      • Create a New Repo
      • Clone a Repo
      • GIT PUSH
      • GIT PULL
      • GIT Check OUT

    13. How to run API automation using DOCKER – Jenkins – CI tool (Continuous Integration)
      • Integration of API Automation with CI-CD process
      • Running test cases from Jenkins

    14. Life Time Free Access on all Videos/Recordings

      Naveen AutomationLabs

      Please follow and like us: