T E S B O

Tesbo

Understanding Tesbo Keywords

Table of Contents

Tesbo Keys for .tests file #

Tesbo keys are the commands that is used to write Test in .tests file to automate the test scenarios. All the keys are pre -defined in Tesbo starting from defining your test, clicking on an element, verifying the results etc. 

All Tesbo keys are case sensitive so make sure you define as mentioned way!!!!

 Following are the list of the Tesbo keys which you can define in tests file.   

Define Test and Title #

Test:  –  keyword use to define the Test Objective/Test Scenario for your test.   For Example,

      Test: Verify Login functionality with valid credentials.

Define Tag for Test #

#  Sign use to define the tag name of the Test Scenario. Tag name helps you to run some kind of test without changing anything in you .tests file.  

# is reserved keyword in Tesbo for Tags so it can't be used anywhere in test scripts.

   For Example,

Test: Verify Tesbo text
#verification 
Step: Scroll to Bottom
Verify: @Tesbo text is equal 'Tesbo'
End

 Set Tag name in config.json file to run the tests by Tag Name. You can also run your test with Multiple tags.

      "by": {
            "Tag": [
              "verification"
            ]
       }

When you need to run a single test or multiple tests then you can use Tag feature. 

Step: – Define Step for Test #

Step: is keyword is used to define your test steps in your script. 

For Example,   

      Step: Click on @Next button

 Code : Define Custom Steps #

Code: is defined to use your External Codes from the CustomStep package. You can define your custom code in this package with @Step annotation and can be utilize in your .tests test scripts.   For Example, 

       Test: T12 - Verify Custom Code
        #regression
            Step: Open URL 'https://www.amazon.in/'
            Code: Window Resize
        End

@ – Define for Locator value #

When you define your locators in your locator package with .json files, you can use those locators with it’s name in your .tests with @ keyword.   For Example, in locator.json file

      {
          "NextButton": "//input[@type='next']"
      }

You can use above NextButton locator with @ in .tests file.

    Step: Click on @NextButton      

Verify: Define for step assertion #

Verify is used to check the assertion of your test scripts like, verifying element display of not, element text is equal or not, contains some text or not etc.    For Example,  

      Verify: @Signup_page is displayed 

Collection Name: Define for Creating Collection #

Collection is a set of steps that you can use into the multiple tests within same tests.          For Example,

      Test: Login on amazon
          Collection Name: amazon_open    
          Step: click on @sign_in button  
          Verify: @Email_Field is displayed   
      End

Collection:  Define for Passing Collection #

      Test: iPhone Search on amazon
          Collection: amazon_open
          Step: Enter 'iPhone 7' in @SearchBox
          Step: Press Enter
      End

End – Define for End Your test #

Normally in Tesbo, the starting point of test case is Test keyword, and the ending point will be the End keyword. When you complete your test script test you need to pass End key to tell Tesbo test is completed.

      Test: iPhone Search on amazon       // Start
     Collection: amazon_open
      Step: Enter 'iPhone 7' in @SearchBox
Step: Press Enter
      End                                 //  End

Enter – Define send data to element (SendKeys)  #

To send the data into the text fields, you need to pass Enter keyword to the Tesbo with the Element locator and text value.  Text value should be passed with single quotes only as ‘Value’

      Step: Enter 'iPhone 7' in @SearchBox

  #

Click – Define click to element #

To click on a particular element like buttons, you can use `Click` keyword in Tesbo with the element you need to Click. 

      Step: Click on @Login Button

Pause : Define wait in sec. #

Sometimes while running your script, you need to pass waits as well for some operation. Tesbo supports Pause keyword to pause your script for defined times in seconds. Pause only support the time in seconds right now. 

      Step: Pause 3 sec 

Open URL : Define for open URL in a particular test #

At the start of your test, Tesbo already opening the URL for you from the BaseURL, but sometimes you need to pass the URL in between your script which is also supported by Tesbo as Open URL and you need to pass that URL with it. 

      Step: Open URL 'https://www.google.com/

  #

Switch to frame :  Define for move to another Frame #

Sometimes while working with multiple frames in your script you require to switch between the frames, you can do that operation directly by Switch to <frame> command. You need to pass that frame id as locator from .json file. 

      Step: Switch to <FrameID> 

 i.e.

      Step: Switch to @IFrame2

Switch to alert then cancel : Define to close the alert box. #

      Step: Switch to alert then cancel 

  #

Switch to default content – Define for go back to main IFrame #

While switching between the iFrames if you need to go back to the main parent iFrame you can also switch back to there from Tesbo command.

      Step: Switch to default content 

Scroll to Bottom : Define for page scrolling top to bottom #

      Step: Scroll to Bottom 

Scroll to Top : Define for page scrolling bottom to top #

      Step: Scroll to Top

Scroll to Coordinate (xpos, ypos)  : Define for X, Y pos Scrolling #

 If you need to scroll your window for the specific coordinates, you can do by Scroll to (xpos, ypos) command with passing xpos and ypos as X and Y coordinate respectively.

      Step: Scroll to (100, 50)  

Scroll to Locator : Define for scrolling element to element #

  Like scrolling Top to Bottom, Bottom to Top, and scrolling by Coordinates, you can also scroll the screen to the particular Locator place. You need to pass that locator name as per the locator.json file.

      Step: Scroll to @Locator

      i.e.  

      Step: Scroll to @Next Button

Pause until @Locator is Disappear #

Define to wait until locator disappears from the screen. You need to pass that locator name as per the locator.json file. 

      Step: Pause until @Locator is disappear

i.e        

      Step: Pause until @Next is disappear

Pause until @Locator is display #

    Define for wait until locator is not display, it will halt your execution and wait for locator to display. You need to pass that locator name as per the locator.json file.

      Step: Pause until @Locator is display

i.e          

      Step: Pause until @Next Button is display  

Pause until @Element is clickable  #

Define for wait until Locator is not clickable, for example, if a button is disable to click, the script will wait until the button is clickable. You need to pass that locator name as per the locator.json file.

      Step: Pause until @Next Button is clickable 

is displayed : Define for Element assertion #

To check whether particular element is loaded and display properly in the screen. You need to pass that locator name as per the locator.json file.

      Verify: @Next Button is displayed  

Text is equal ignore case : Define for Element text verification (Equal Ignore case) #

  To verify the element text, Tesbo provides command `Text is equal ignore case` which will check the element text is equal with the passed text ignoring the case sensitivity. You need to pass that locator name as per the locator.json file. 

      Verify: @Google text is equal ignore case 'google'  

Text is equal : Define for Element text verification (Equal) #

  Same as above, to verify the element text, Tesbo provides command `Text is equal` which will check the element text is equal with the passed text with the case sensitiveness. You need to pass that locator name as per the `locator.json` file.

        Verify: @Google text is equal 'Google'  

Text is contains : Define for Element text verification (Contains) #

To verify the part of text from the element text, Tesbo provides command text is contains which will check the element text contains certain part of provided string in it with case sensitiveness. You need to pass that locator name as per the locator.json file. 

      Verify: @Locator text is contains 'contains' 

    i.e    

      Verify: @Google text is contains 'Goog'   

Text is contains ignore case  – Define for Element text verification (Contains ignore case) #

To verify the part of text from the element text, Tesbo provides command Text is contains ignore case which will check the element text contains certain part of provided string in it ignoring the case sensitivity. You need to pass that locator name as per the `locator.json` file.

      Verify: @Google text is contains ignore case 'Google'

Multiple assertions in a single step #

Tesbo provide the feature to declare multiple assertion in single step, following the various ways you can use that.

Verify: @element1 @element2 @element3 is displayed
Verify: @element1 @element2 text is equal to 'New Text'

Define multiple assertion using ‘And’ Keyword, in that if both element value is true then it will going to pass. 

Verify: @element1 text is equal 'element text value' And @element2 is displayed and @element3 text is equal to 'element3 text value'
Verify: @element1 text contains is 'element1 text' and @element1 is displayed

DataSet: – Define for enabling Data Driven Format  #

As Tesbo is the Hybrid Framework design, it allows you to work with Data Driven Approach. In Tesbo, to work with Data you need to create a DataSet and pass it to the .tests file.

      DataSet:
             {
                 "Credentials": {
                 "username":  "qa.tesbo@gmail.com",
                 "password": "password",
                 }
             }

excelFile: – Define to pass Excel with DataSet #

        DataSet:
             {
                   "GmailUsers": {
                   "excelFile": "E:/GmailData.xlsx"
                   } 
               } 

When you use the excelfile, Tesbo identifies the total rows from excel and column used in test and execute the same test with the different data #

Press Enter – Define for Press Enter key #

Sometimes after filling form, you can also use the keyboard `Enter` key to submit your form, Tesbo provide inbuilt keyword for same as `Press Enter` to click the Keyboard Enter button.   

      Step: Press Enter

              You can also pass the `Enter` command to locator as well. You need to pass that locator name as per the `locator.json` file.           

     Step: Press Enter on @Locator

Clear : Define for clear element #

 Like we used Enter command to send the data in text field, you can also use the Clear keyword to clear the text from the text fields. You need to pass that locator name as per the locator.json file.   You can define command in two different ways.                     

      Step: Clear text from @Google_search

TAB –  Define for Press TAB key #

  As we have seen above the keyboard `Enter`, you can also use the Keyboard `TAB` button too for switching between the fields (which is basically used in many websites).          

      Step: Press TAB

  #

‘CTRL’ Plus ‘A’ – Define for Press Control + A key  (Select all text) #

  Mostly we are using the Keyboard shortcuts to select all the items as `’CTRL’ Plus ‘A’` which is also supported by Tesbo commands as below. 

      Step: Press 'CTRL' Plus 'A' in @Locator

‘CTRL’ Plus ‘C’ –  Define for Press control + C key  (Copy selected text)   Same as above, to copy the text, Tesbo supporting the ‘CTRL’ Plus ‘C’ command as below. 

      Step: Press 'CTRL' Plus 'C' in @Locator

‘CTRL’ Plus ‘V’` Define for Press control + V key  (Paste copied text) #

 This command is used by Tesbo to paste the copied content, which is basically used the Keyboard shortcuts ‘CTRL’ Plus ‘V’ as below.

      Step: Press 'CTRL' Plus 'V' in @Locator

Session: – Define for Multi Driver Functionality #

While running your test which multiple user, you can define the session to use your different user with multiple drivers, this sessions are defined as Session: keyword in Tesbo.   First you need to define the session names in .tests file.

      Session: Browser_1, Browser_2,

              You can use those session names in your text script as per needed in automation.

      [Browser_1]
          Step: Open URL 'https://www.linkedin.com/'
          Step: Enter 'client@gmail.com' into @emailTextBox
          Step: Enter 'password' into @passwordTextBox 
      [Browser_2]  
          Step: Open URL 'https://www.gmail.com/'
          Step: Enter 'client@gmail.com' into @emailTextBox
          Step: Enter 'password' into @passwordTextBox  

Double click – Define for Double click #

  Tesbo also support the double mouse click as well in your test scripts.

      Step: Double click on @TextPath

Right click – Define for Right click #

  To work with the mouse right click, Tesbo supports Right click command as below. 

      Step: Right click on @sign_in button

Clear Cookies – Define for Clear Cookies #

  In Tesbo, it’s also easy to clear your browser cookies while doing automation. You don’t need to write any bunch of extra codes for that. 

      Step: Clear Cookies

Clear Cache – Define for Clear Cache #

  In Tesbo, it’s easy to clear your browser cache while doing automation. You don’t need to write any bunch of extra codes for that. 

      Step: Clear Cache

 Capture Screenshot :  Define for Capture Screenshot  Apart from capturing the screenshot on Test Failure, Tesbo is also supporting the screen capture in the test. You need to pass the `Capture Screenshot` keyword in the step.

      Step: Capture Screenshot

Select From Dropdown – Define for Select element from dropdown #

To select a value from the drop-down, Tesbo also providing the keyword as Select From Dropdown to select the option from the list. To select the option Tesbo supports three different ways to select by textindex or value

      Step: Select using text '<Element Text>' from @DropDown
      Step: Select using index 7 from @DropDown
      Step: Select using value '<Element Value>' form @DropDown    

Deselect From Dropdown – Define for Deselect element from dropdown #

You can also deselect the selected option from the dropdown by Tesbo. You can use a keyword as Deselect From Dropdown with three different selection by    textindex or value

      Step: Deselect using text '<Element Text>' from @DropDown
      Step: Deselect using index 7 from @DropDown
      Step: Deselect using value '<Element Value>' form @DropDown

Mouse Hover – Define for Mouse Hover #

  To hover your mouse to particular element, Tesbo provides the `Mouse Hover` command.

      Step: Mouse Hover @sign_in Button  

Select element form list – Define for Select element form list #

Sometimes happens your locator will find the multiple elements as the list. To choose elements rom the list you can also choose it by the Select element form list command with first elementlast element, by it’s value or it’s index

      Step: Click on first element from List @bootstrapElementList
      Step: Click on last element from List @bootstrapElementList
      Step: Click on "<Element Value>" element from List @bootstrapElementListSecond
      Step: click on <0> from List @bootstrapElementListSecond 

Get Page Source – Define for Get Page Source  #

  Even with Tesbo, you can get the current Page source as well by below command. 

      Step: Get Page Source            

Upload File – Define for Upload File #

Basically working with automation, you’ll also find scenario where you need to upload some file or document. Tesbo has inbuilt command to work with that operation  as Upload File and with this you need to pass the local path of that file as well the locator of that upload element.

      Step: Upload File 'filePath' @element  

      e.g.

      Step: Upload File 'C://myfile.txt @uploadButton          

Click and Hold – Define for click and hold #

  Tesbo too supports the `Click and Hold` functionality as well to the particular element.

      Step: Click and Hold @element           

Capture Screenshot of element – Define for Capture Screenshot of Element #

  Not only limited to capture the screen, but you can also capture the Element in the screenshot by Tesbo. You need to pass the locator for that element with `Capture Screenshot of element` command.

      Step: Capture Screenshot of @element   

Drag and Drop – Define for Drag and Drop #

You may also face the situation in the automation where you need to drag and drop the particular element from one place to another. You can use the command `Drag and Drop` along with your element locator in Tesbo. 

  Step: Drag and Drop @element_1 to @element_2      
  Step: Drag @element_1 to @Drop and element_2

Get cookies : Define for Get cookies #

  Like clearing the cookies while automation, you can also get cookies and can also check if a cookie with the same name is available or not.

      Verify: Get cookies and check 'Any cookies name' is available

Scroll Horizontal : Define for Scroll to Horizontal #

  As we already have seen Tesbo supports the Top-Bottom scrolling, it also supports the Horizontal scrolling too. 

      Step: Scroll to Horizontal

  This command is used to get print your element text, for that you need to pass you element locator with it. Print any Text

      Step: Print "Your Text"

Print Element Text

      Step: Print @Element   //Element text will be printed

Tesbo Special Characters  #

@ - (At) : Use for defining the locators in .tests file.
# - (HashTag) : Use for defining the Tags in your test.
{ } - (Curly braces) : Use only for defining the DataSet parameters 
[ ] - (Square brackets) : Use only to define the Session in the Test scripts. 
' ' - (Single quotes) : Use only to pass the parameters to the element.
< > - (Less than and Greater than) : Use only to select the element from the list by it's number.  

Powered by BetterDocs

Leave a Comment