Create 1st automation project – SoliteraTA

SoliteraTA

View Categories

Create 1st automation project

Introduction #

This guide is designed to help you write your first automation script using SoliteraTA, a versatile tool for web testing. We’ll automate a basic operation on SoliteraTA.com, demonstrating each step in detail. No programming experience is needed, so let’s get started!

Prerequisites #

Make sure SoliteraTA is installed on your system. If not, download and install STA.

Step-by-Step Guide #

Step 1: Setting Up Your Workspace #
  1. Open STA: Launch SoliteraTA.
  2. Create Workspace: Click the ‘+’ icon in the upper right corner.
  3. Access Workspace: Click on the workspace card to open it.
Step 2: Creating a New Project #
  1. New Project: Click on the ‘+’ icon.
  2. Project Details: Enter the project name and choose a save location.
  3. Open Project: Click on the project name.
Step 3: Setting Up the Application File #
  1. Add Application File: In the default_Release section, right-click on Applications and select “Add Application File”.
  2. File Details: Enter the application file name, a config name, and set Config URL as “https://soliterata.com/“.

Create File: Click “create”.

Application File Structure

<environment>
  <config>
    <name>SoliteraTA</name>
    <type>web_application</type>
    <url>https://soliterata.com</url>
    <cookie>true</cookie>
  </config>
  <!-- Browser configurations -->
</environment>

Your final application file will look like this:

<!-- Your Environment will be displayed here -->
<environment>
  <config>
    <name>SoliteraTA</name>
    <type>web_application</type>
    <url>https://soliterata.com</url>
    <cookie>true</cookie>
  </config>
  <config>
    <name>Browser1</name>
    <type>web_browser</type>
    <browser_name>Chrome</browser_name>
  </config>
  <config>
    <name>Browser2</name>
    <type>web_browser</type>
    <browser_name>Edge</browser_name>
  </config>
  <config>
    <name>Browser3</name>
    <type>web_browser</type>
    <browser_name>Firefox</browser_name>
  </config>
  <config>
    <name>Browser4</name>
    <type>web_browser</type>
    <browser_name>Safari</browser_name>
  </config>
</environment>
Step 4: Creating the Element File #

Add Element File: Right-click on elements in the project directory and name your elements file.

Element File Structure

<elements>
  <element>
    <name>acceptCookiesBtn</name>
    <type>XPATH</type>
    <value>//span[text()='Accept']</value>
  </element>
</elements>

In this file, you define each element you will interact with in your script. Replace acceptCookiesBtn, XPATH, and the XPATH value with the appropriate element name, type, and selector from the web page.

Your final element file will look like this

<!-- Your Elements will be displayed here -->
<elements>
  <element>
    <name>acceptCookiesBtn</name>
    <type>XPATH</type>
    <value>//span[text()='Accept']</value>
  </element>
  <element>
    <name>SoliteraTA_TestingPlaygroundTab</name>
    <type>XPATH</type>
    <value>(//a[@href="https://soliterata.com/testing-playground/" and contains(@class,"menu-item")])[1]</value>
  </element>
  <element>
    <name>FormsTab</name>
    <type>XPATH</type>
    <value>//h5[text()='Forms']/parent::div/parent::div/parent::div</value>
  </element>
  <element>
    <name>practiceFormEnterTextLink</name>
    <type>XPATH</type>
    <value>//span[text()='Practice Form Enter Text']</value>
  </element>
  <element>
    <name>inputField</name>
    <type>ID</type>
    <value>contentInput</value>
  </element>
  <element>
    <name>submitBtn</name>
    <type>XPATH</type>
    <value>//button[text()='Submit']</value>
  </element>
  <element>
    <name>printedContent</name>
    <type>ID</type>
    <value>printedContent</value>
  </element>
</elements>
Step 4: Creating the Script File #
  1. Script Editor: Click the “Script Editor ‘pencil icon'”.
  2. Add Script File: Right-click on the project folder, select “add script file”, enter a name, and click “create”.
  3. Insert Step Definitions: Use ‘STEP DEF’ to add pre-defined scripts and scenarios.

Script File Example (gherkin) :

Feature: First Script

Scenario: Navigate to SoliteraTA website 
Given use "Browser3" browser for execution
Then navigate to URL "SoliteraTA"
When maximize window

Scenario: Print Entered text in SoliteraTA testing playground 
Then verify element "acceptCookiesBtn" is displayed on the UI
Then click on element "acceptCookiesBtn"
Then click on element "SoliteraTA_TestingPlaygroundTab"
Then click on element "FormsTab"
Then click on element "practiceFormEnterTextLink"
Then enter value "Solitera Test Automation First Script" for element "inputField"
Then click on element "submitBtn"
Then verify element "printedContent" is displayed on the UI

In this script, replace Browser3, SoliteraTA, and other element names with the appropriate browser type and element names you defined earlier.

Step 6: Executing the Script #
  1. Save Script: Ensure your script is saved.
  2. Execute: Click the green button to run the script.
  3. View Reports: After execution, view reports through the ‘reports’ option.

Explanation of the Process #

  • Launching and Navigating: The script opens the browser and navigates to SoliteraTA.
  • Interacting with Elements: It interacts with elements like buttons and input fields, identified by their unique selectors.
  • Performing Actions: The script automates actions like clicking buttons, entering text, and submitting forms.
  • Verification: Finally, it verifies if certain elements are present or if actions have occurred, ensuring the functionality works as expected.

Conclusion #

You’ve successfully automated a basic testing operation on SoliteraTA. This guide should have provided a clear understanding of how to use SoliteraTA for automating web testing tasks. As you gain more experience, you can explore more complex automation scripts to further enhance your testing capabilities. Happy testing!

Solitera may collect certain information by automated means, such as cookies and web beacons, when a user visits our website. A “cookie” is a small piece of data that a website can send to your browser, which may then be stored on your system. learn more