我有一个至少包含 3 个<ui-select></ui-select>
标签的表单,当我运行 Katalon 自动测试时,我无法使用 Web UI 关键字Select Options by value
来设置元素的值。有没有办法解决这个问题?希望看到你的经历...
*.HTML:
<ui-select theme="select2" ng-model="dataPalete.fid" ng-required="true">
<ui-select-match placeholder="..."><% $select.selected.name %></ui-select-match>
<ui-select-choices repeat="fruits.id as fruit in fruit_select | filter: $select.search">
<span ng-bind="fruit.name"></span>
</ui-select-choices>
</ui-select>
<script>
app.controller('fruitController', function($scope){
$scope.fruit_select = [
{id: 'APPL', name: 'Apple'},
{id: 'BANN', name: 'Banana'},
{id: 'ORGA', name: 'Orange'}
];
});
</script>
*卡塔隆脚本:
import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
import com.kms.katalon.core.testdata.TestData as TestData
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import internal.GlobalVariable as GlobalVariable
...
CustomKeywords.'com.katalon.plugin.keyword.angularjs.DropdownKeywords.selectOptionByName'(findTestObject('Fruit/dropdown_selectfruit'),'Apple')
Katalon提供了很多插件。 https://store.katalon.com
你看过这个吗?https://store.katalon.com/product/23/AngularJS-Dropdown-Keywords
他似乎在回应你的请求。