Thursday, March 10, 2022

Selenium 4


 New Features and Updation in Selenium 4:

1. Selenium is now W3C compliant:

  • JSON wire protocol was used to communicate between the SE Webdriver API's and the browser native APIs
  • With W3C compliance. the communication happens directly without any encoding and decoding required
  • Any software following W3C standard protocol can be integrated with Selenium with no compatibility issues

2. Relative Locators:

  • Function to locate nearby elements by specifying directions
  • Existing locator strategy        

3. Better Window and Tab Management:

  • Work with multiple windows or tabs in the same session
  • Can now open multiple windows and tabs without creating a new driver object

4. Improved Selenium Grid:

    Selenium Grid helps in Distributed Test Execution
  • Enables test execution on different combinations of browsers, OS, and Machines
  • Enables parallel execution
    Selenium Grid is now redesigned

    Docker support
    Enables to spin up the containers. (No need to set up VMs)
    Enables to deploy the grid on Kubernetes for better scaling

    Easier Management - No need to set up and start hubs and nodes separately

    3 ways to run Se Grid

    Standalone Mode
    Hub and Node
    Distributed

    a. Standalone Mode:

    The new Selenium Server Jar contains all the functionalities needed to run a grid
                       java -jar selenium-server-4.0.0.jar standalone
   The Grid automatically identifies that the WebDriver for Chrome and Firefox are present on the system

    b. Hub and Node:

    The classical way of using the Grid for selenium test Automation consists of two major components i.e. Hub and Node
        start hub:             java -jar selenium-server-4.0.0.jar hub
        register node:      java -jar selenium-server-4.0.0.jar node --detect-drivers

    c. Distributed:

        Grid 4 can be started in a fully distributed manner, with each piece running in its own process
        Selenium Grid 4 consists of four processes: 
        Router,
        Distributor, 
        Session and 
        Node

5. Upgraded Selenium IDE:

        Record and Playback tool
        Available as an add-on - Firefox, Chrome, and MS Edge
    • More stable and reliable            
    • Improved GUI
    • SIDE runner - Se IDE runner for CMD execution, grid, and node projects
    • Better element locator strategy

6. New APIs for CDP (Chrome DevTools Protocol): 

        Chrome DevTools - Set of tools built directly into chromium-basedbrowsers like chrome, Opera, and Microsoft Edge to help developers to debug and investigate the websites
    • Inspects element in the DOM
    • Edit elements and CSS on the fly
    • Check and monitor the site's performance
    • Mock Faster/Slower network's speeds
    • Mock geolocations of the Users
    • Execute and debug JavaScript
    • View console logs
    • Se 4 comes with native support for Chrome DevTools API
    • Capture and monitor the network traffic
    • Simulate poor network conditions
    • Perform geolocation testing
    • Change device mode to do responsive design testing
    new ChromiumDriver class, which includes two methods to access chrome devTools
    1. getDevTools()
    2. executeCdpCommand()  

7. Deprecations of Desired Capabilities:

    Desired Capabilities were primarily used in the test scripts to define the test environment (browser name, version, and operating system) for execution on the Selenium Grid
    Capabilities objects are replaced with options:
    • Firefox - FirefoxOptions    
    • Chrome - ChromeOptions
    • IE - InternetExplorerOptions
    • Microsoft Edge - EdgeOptions
    • Safari - SafariOptions
    Cloud-based Selenium Grid setup

        ChromeOptions options = new ChromeOptions();
        options.setAcceptInsecureCerts(true);
 
        options.setCapability("build", "Testing Chrome Options [Selenium 4]");
        options.setCapability("name", "Testing Chrome Options [Selenium 4]");
        options.setCapability("platformName", "Windows 10");
        options.setCapability("browserName", "Chrome");
        options.setCapability("browserVersion", "latest");

7. Modifications in the Actions class: 

    Actions class in Selenium is used to simulate input actions from mouse and keyboard on specific web elements (e.g. Left Click, Right Click, Double Click etc)












Monday, May 24, 2021

 My First AWS Instance:


My First RDP Machine in AWS:


If you need any help to instantiate the RDP with running instances ...

Tuesday, May 4, 2021

Kindly contact for online software testing courses by video conference.

Courses Available For Engineering Students:

  1. Software Manual Testing

  2. Software Automation Testing

  3. Selenium WebDriver

  4. Core Java

  5. BrowserStack, Mailinator, Jenkins, Jira, TestRail, and other testing related tools

    Kindly contact: 1feb1986@gmail.com

    You can use the contact form for any query.

    Thanks: Prashant Chauhan

 General Principles of Testing:

===================

  • Principle 1: Testing shows the presence of defects, not their absence.

Testing can show that the product fails, i.e., that there are defects. Testing cannot prove that a program is defect-free. Adequate testing reduces the probability that hidden defects are present in the test object. Even if no failures are found during testing, this is no proof that there are no defects.

 

  • Principle 2: Exhaustive testing is impossible.

It’s impossible to run an exhaustive test that includes all possible values for all inputs and their combinations combined with all different preconditions. Software, in normal practice, would require an “astronomically” high number of test cases. Every test is just a sample. The test effort must therefore be controlled, taking into account risk and priorities.

 

  • Principle 3: Testing activities should start as early as possible.

Testing activities should start as early as possible in the software life cycle and focus on defined goals. This contributes to finding defects early.

 

  • Principle 4: Defect clustering. Defects are not evenly distributed; they cluster together.

Most defects are found in a few parts of the test object. Thus if many defects are detected in one place, there are normally more defects nearby. During testing, one must react flexibly to this principle.

 

  • Principle 5: The pesticide paradox. Insects and bacteria become resistant to pesticides.

Similarly, if the same tests are repeated over and over, they tend to lose their effectiveness: they don’t discover new defects. Old or new defects might be in program parts not executed by the test cases. To maintain the effectiveness of tests and to fight this “pesticide paradox,” new and modified test cases should be developed and added to the test. Parts of the software not yet tested, or previously unused input combinations will then become involved and more defects may be found.

 

  • Principle 6: Testing is context-dependent.

Testing must be adapted to the risks inherent in the use and environment of the application. Therefore, no two systems should be tested in the exactly same way. The intensity of testing, test exit criteria, etc. should be decided upon individually for every software system, depending on its usage environment. For example, safety-critical systems require different tests than e-commerce applications.

 

  • Principle 7: No failures mean the system is useful is a fallacy.

Finding failures and repairing defects does not guarantee that the system meets user expectations and needs. Early involvement of the users in the development process and the use of prototypes are preventive measures intended to avoid this problem.

 

#HappyLearning

Wednesday, October 9, 2019

How to work with Test Fairy links to upload the build in browser stack ?



When you get the test fairy mail for installing any build on browser stack then follow below rules:


  • Open the Test Fairy mail
  • Click on the install app link like Click Here
  • One url will open like "https://my.testfairy.com/download/74R32C9K70TJTD1J68W38DHN6DVQ0PMW1V3AFVVND4RYFYHSWPNY5DSC/getapp?_=1569570891"
  • Delete the url from backward till /getapp like "https://my.testfairy.com/download/74R32C9K70J68W38DHN64SJV6DVQ0PMW1V3AFVVND4RYFYHSWPNY5DSC/"
  • Add install.plist text on same place like "https://my.testfairy.com/download/74R32C9K70TJTD1J68W38DSJV6DVQ0PMW1V3AFVVND4RYFYHSWPNY5DSC/install.plist"
  • And submit the url
  • Copy the ipa String url from new xml page like: <string>https://d3bgf4y6nbjwg6.cloudfront.net/73673/8e8a67153d2abe619f6b7bdb03fc2a4c12a1e9c9/ApplicationName.ipa </string>
  • Open this ipa url to browser and get the submit button then one build will be saved in your system
  • Then upload this build to the browser stack and you will be ready to test the build