Create object manual and get value element

a dhiyaul asikin
1 min readNov 27, 2019

--

Import file to create object manual in testcase

import internal.GlobalVariable as GlobalVariable
import com.kms.katalon.core.testobject.ConditionType as ConditionType

Path location element

String Name = ‘//div//input[@name=”policyName”][@data-vv-delay=”-1"]’

Create Object

TestObject PolicyName = new TestObject(“objectName”)
PolicyName.addProperty(“xpath”, ConditionType.EQUALS, Name)

Get Value Element

def ValueName = WebUI.getAttribute(PolicyName, ‘value’)

Check data value

WebUI.verifyEqual(text, “Police Name”)

Random Data :

Row = ((Math.random() * 6) + 1 as int)
Column = ((Math.random() * 5) + 1 as int)
String xpath = (((‘//table[@class=”table-condensed”]//tbody//tr[‘ + Row) + ‘]//td[‘) + Column) + ‘]’

Create new object

TestObject to = new TestObject(‘objectName’)to.addProperty(‘xpath’, ConditionType.EQUALS, xpath)

Click element

WebUI.click(to)

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

a dhiyaul asikin
a dhiyaul asikin

No responses yet

Write a response