Working on GitHub Desktop Automation with Electron Block

Working on GitHub Desktop Automation with Electron Block

Introduction

In this article, we will discuss why it is important to open the GitHub Desktop application in Normal Window mode only using the Start Electron Application building block. To get an overview of automating Electron applications in Leapwork, please refer to our previous article.

For a successful automation, it is quite crucial to open GitHub Desktop application in Normal window mode only using the 'Start Electron Application block otherwise, Leapwork will not be able to interact with the application properly, and following errors may occur:

Using Start Electron Application Building Block Makes Sure:

Prerequisites:

Electron apps use different versions of the Chromium browser. To automate these applications in Leapwork, you need the correct ChromeDriver version.

  1. Download ChromeDriver Versions: Get all major ChromeDriver versions.
  2. Save Drivers in Leapwork: To ensure smooth automation, it’s quite crucial to place Chromedriver in both the Studio and Agent driver folders:
    • Studio Directory: C:\Program Files\LEAPWORK\Studio\driver\chrome
    • Agent Directory: C:\Program Files\LEAPWORK\Studio\driver\chrome

Note: To ensure Leapwork can properly interact with GitHub Desktop application, the ChromeDriver version must match the Chromium version in the Electron app. So, it’s a good practice to have all major ChromeDriver versions available as shown below and Leapwork will automatically choose the right one, making automation smoother and error-free.

Steps to Configure:

  1. Open Leapwork Studio and add the 'Start Electron Application' block to your flow.

  2. In the block's properties, specify the path to the 'GitHub Desktop' executable by clicking on the three dots button as shown in the image. With the Arguments field in the Start Electron Application building block, you can pass additional command-line arguments to the Electron application when it starts. It will customize the application’s launch behavior or specify the options the way it will start.

  3. Once you specify the path to GitHub Desktop application, Leapwork will detect if the application is an Electron application or not and display the message.

    • If the detected application is not an Electron application, you will see the below image, click on the OK button and select the correct path to your GitHub desktop application.

    • If the application is an Electron application, Leapwork would show a prompt for confirmation as shown below. If the user wants to keep using the desktop blocks to automate the application, the user needs to select "Continue" and if the user wants to use the Electron blocks, the user needs to "restart" GitHub desktop application.

  4. Once the application is successfully detected by Leapwork, proceed to set the Window mode to Normal by following the steps below:

    • Open Leapwork Studio.

    • Add the 'Start Electron Application' block to your flow.

    • Expand the block and find the 'Window Mode' setting. You will see that by default, the selection is "Maximized". Choose 'Normal' from the dropdown menu.

    • If you don’t set window mode to Normal, Leapwork will not be able to interact with elements of the application and you might see blank in the captured elements leading to flow failure.

    • After selection in the dropdown, Save your changes. This step is essential for the automation to function properly.

  5. You’re set to Save and run your automation flow.

Building Blocks:

Leapwork provides specialized building blocks to automate Electron-based applications. These blocks are designed specifically for Electron apps and can be found under the “Electron” menu in the “Add Building Blocks” section.

Key Troubleshooting Areas and Steps:

  1. Wrong Path to GitHub Desktop:

    • What Might Go Wrong: Leapwork can’t recognize GitHub Desktop.
    • What To Do: Double-check and correct the path to the app.
  2. ChromeDriver Version Mismatch:

    • What Might Go Wrong: Leapwork is unable to work with GitHub Desktop.
    • What To Do: Make sure all major ChromeDriver versions are saved in the right folder. (C:\Program Files\LEAPWORK\Studio\driver\chrome).
  3. Not Using the Correct Start Block:

    • What Might Go Wrong: Automation flow failed.
    • What To Do: Always open GitHub Desktop with the 'Start Electron Application' block.
  4. Window Mode Not Set to Normal:

    • What Might Go Wrong: Automation tasks fail as Leapwork failed to identify and interact with application UI elements.
    • What To Do: Set the 'Window Mode' to 'Normal' in the settings.
  5. Confusion with Electron App Detection:

    • What Might Go Wrong: Not sure whether to use regular or Electron blocks.
    • What To Do: Click "Continue" for regular desktop blocks or "Restart" GitHub Desktop for Electron-specific blocks.

For further assistance or clarification, please contact our Priority Support team.