T E S B O

Tesbo

How to define, set and use Global variables

Global variables are define in ‘.json‘ file on ‘DetaSet‘ directory.

i.e

{
"Credentials": {
"UserEmail": "Tesing123",
"Password": "test123",
"UserName":""
}
"NewData": {
"Variable1": "",
"Variable2": "",
}
}

For set Element Text, Size of Element, Page Title, Current URL, Attribute Value and CSS Value on global variable.

Syntax:

Step: Get text of @element and set | put | assign in to {DataSet variable}
Step: Get size of @element and set | put | assign in to {DataSet variable}
Step: Get page title and set | put | assign in to {DataSet variable}
Step: Get current url and set | put | assign in to {DataSet variable}
Step: Get attribute 'attribute name' of @element and set | put | assign in to {DataSet variable}
Step: Get css value 'css value' of @element and set | put | assign in to {DataSet variable}

 i.e: ‘data.json’ file in ‘DetaSet’ directory

{
"Credentials": {
"errorMessage":"testing",
"errorMessage1":"validation message",
"numberOfTextbox":"",
"attributeValue":"",
"titleNameOfPage":"".
}
}

You can find a similar example from Tesbo-Skeleton as well

i.e

Test: Set Variable value
DataSet: Credentials
Step: open url 'https://accounts.google.com/signup'
Step: Click on @Next
Step: Get text of @FirstNameError and set it on {errorMessage}
Step: Get text of @LastNameError and put it on {travelUser}
Step: Get text of @UserNameError and assign it on {errorMessage1}
Step: Get size of @textBoxes and assign it on {numberOfTextbox}
Step: open url 'https://www.mathsisfun.com/numbers/counting.html'
Step: Get attribute 'href' of @AlgebraTab and set in to {attributeValue}
Step: Get page title and assign it on {titleNameOfPage}
End

You can find a similar example from Tesbo-Skeleton as well

Powered by BetterDocs

Leave a Comment