HomeVitaq AI

Visual Scripting with Vitaq AI Test Automation Tool

Visual Scripting with Vitaq AI Test Automation Tool

<<Complete Vitaq AI Tutorial>>                                         Next Post>>

Visual Scripting with Vitaq AI Test Automation Tool

In this next article of the Vitaq AI Test Automation Tutorial Series, I will demonstrate how we can use the power of Visual Programming in Scriptworks through Vitaq AI to achieve our Test Automation Goals.

For non-coders, the most productive way to work with Vitaq through Selenium and Appium for web and mobile app testing is to use the power of Visual Programming in Scriptworks. This includes a very powerful AI-enabled smart selector strategy to help remove the pain of brittle selectors. Scriptworks also has a very helpful ‘selector inspector’ tool, to identify the robust selector strategies and also check that they work effectively.

Let’s find it out how Scriptworks visual coding works with Vitaq AI:-

1) Navigate to https://www.scriptworks.io/ and Login to your scriptworks cloud account with your scriptworks username and password.

2) On the Home page of Scriptworks click on New Project.

 3) Give the name of the project let’s say “SwagLabsScriptworks” and give a small description of the project.

 

4) Click on New Test and complete the Test Info and Click on Save Button.

5) Now open the Vitaq AI Test Automation Tool.

6) Click on Edit, select Preferences, and click on it.

7) Check Use Scriptworks Integration checkbox, Enter Username and Password and click on Connect to establish a connection between Vitaq AI and Scriptworks cloud, now Click on Scriptworks Project Load button to select your Project name which we have given in Step 3. And Then  Click on Scriptworks Run Settings Load Button to select the desired Browser Settings.

8) Now In Edit Preferences Box Check Use Coverage Checkbox. Make sure Database Information is present. Now Check Use AI Checkbox as well and click on Ok Button.

9) Click on File and Select New and Click on it.

10) Enter the name of the new test activity file, for example, I am giving it as the name of “SwagLabsScriptworks” same as I have given in scriptworks to maintain consistency across Vitaq AI and Scriptworks for better understanding.

11) Now Click on New Action and Create a Test Action Let’s say “Login” and likewise create all your required Test Actions as per the shopping app under test needs. Once you connect your test action to the next allowable test action to complete all of your user stories, you will have completed your beautiful Test Activity Diagram. This visual model of your test space provides a powerful springboard to now complete the details of your individual test action scripts (the programming part of testing).

12) Now to create the Test Action functions in Scriptworks (which will have the same name as your test actions to map the visual code to your Test Activity diagram). Click on Edit and Select Create Scriptworks Functions and click on it. It will generate the same name functions in scriptworks of each and every test action of the Vitaq AI Test Activity Diagram. 

13) We will be running a short User Journey for learning purposes. Looking at that we can create the remaining user journeys with ease.

User Journey:- 

‘Login --> products --> clickOnBackPack --> clickOnAddToCart Then clickOnShoppingCart -->clickOnContinueShopping’

14) Let’s take a look at how we can make visual coding our Vitaq test actions in Scriptworks. We’ll show you how we do it for the ‘Login’ action. 

To make Login Function (which is a test action in Vitaq AI) test code in scriptworks visual coding, we need to think about what elements are actually required to login to an application.

Elements required are:- 

  1. Username 
  2. Password
  3. Login Button

Let’s find the locators of the above-mentioned elements through the ‘Selector Inspector Tool’ inside scriptworks. And then use them in Login Function to complete Login Functionality.

i) Click on the element inspector icon available on the left panel.

ii) Enter the Url of the website and click on the start button so that website can appear on the page and one can locate the required element out of it.

iii) Click on the ‘+’ icon to add an element in the element inspector tool.

iv) Enter the name of the element and click on Toggle Inspect Icon to locate elements and hover over the element for which you want XPath. Now Scroll down and select the checkbox for the available attributes you have and click on the ‘convert to selector’ button, then click on the Save button. 

Voila! your username element with an appropriate selector is ready to use.

v) In a similar fashion, we can create the element locator for password and login button elements.

vi) Now Click on Function Icon ‘fx’ present on the bottom of the left panel, list of functions will appear in Function Workspace and double click on pencil icon present in front of Login Function.

 vii) Click on the Element icon on the left panel so that you can see elements created so far. Click on the username element, the slider will open on the right stating all the operations you can do with that element, so we need to perform click on a username and enter text into the username field. So we will drag “click on username” and “username type” fixtures into the Login Function.

viii) Same thing we will do with the password and login element to complete login functionality.

ix) As we have completed the Login function. go back to the high-level function shown in Step (i), and complete the remaining function in the same way as we did here for Login Function.

15) To Run this User Journey on Vitaq we need to start our Scriptworks Vitaq Client and Selenium Server. Open two Linux terminals.

To Run Scriptworks Vitaq Client Use Command:-

“./scriptworks_vitaq_client.js”

To Run Selenium Server Use Command:-

“./selenium_server.sh”

16) Now Click on the Play Button under the Sequence Tab associated with your created User Journey and achieve your Test Automation Goal via Vitaq AI Client Interaction with Scriptworks Client.

This is how a non-coder can achieve their user journeys and required Automation Goals by using the productive and intuitive power of drag and drop coding blocks inside Scriptworks through Vitaq AI Test Automation.

Stay tuned for more articles on Vitaq AI Test Automation Tool.

Next Steps:

> To learn more about Vitaq AI, continue to the next post (Click on Next Post link below)

> Check complete Vitaq AI Tutorial Contents here (Click here)

Please leave your questions/comments/feedback below.

Happy Learning?

About Me > Ajay Lunia 

Connect to me on LinkedIn (Click here)

On a mission to help the Software Testing Community in all possible ways.

<<Complete Vitaq AI Tutorial>>                                        Next Post>>

Comments (0)

Leave a Reply

Your email address will not be published. Required fields are marked *