首页 > 解决方案 > 在一个测试对象中输入数据会在katalon studio中的另一个测试对象上输入值

问题描述

我正在尝试在表单中输入值。但是在一个测试对象中输入值会在另一个测试对象中执行值。例如,在 input_Phone_form-control 中输入“3213213”,在 input_Location_form-control 中输入值

这是生成的在此处输入图像描述脚本:

WebUI.openBrowser('')

WebUI.navigateToUrl('https://api-dev-new.eeposit.com/openseed/#/')

WebUI.setText(findTestObject('Object Repository/Page_Open Seed/input_LOG IN_form-control'), 'info@eeposit.com')

WebUI.setEncryptedText(findTestObject('Page_Open Seed/input_LOG IN_form-control'), '9G0Ij+ZUwmw=')

WebUI.click(findTestObject('Page_Open Seed/button_LOG IN'), FailureHandling.STOP_ON_FAILURE)

WebUI.click(findTestObject('Object Repository/Page_Open Seed/button_Add New Company'))

WebUI.setText(findTestObject('Object Repository/Page_Open Seed/input_Company Name_form-control'), 'company private limited')

WebUI.setText(findTestObject('Page_Open Seed/input_Location_form-control'), 'Florida')

WebUI.setText(findTestObject('Page_Open Seed/input_Phone_form-control'), '3213213')

WebUI.setText(findTestObject('Page_Open Seed/input_Email_form-control'), 'test@email.com' )

WebUI.click(findTestObject('Object Repository/Page_Open Seed/button_Save Company'))

标签: katalon-studio

解决方案


当多个 UI 元素具有相同的标识符时,就会发生这种情况。您需要检查 input_Phone_form-control 和 input_Location_form-control 对象并设置Detect object by选项。 通过检测物体


推荐阅读