在gitlab ci上执行时找不到测试对象

时间:2018-12-10 08:27:22

标签: gitlab katalon-studio

我正在gitlab-ci上运行自动化测试。我已经确认可以在本地单击测试对象,但是在gitlab ci上失败了。我使用Windows 10环境,运行程序在Docker上执行,尤其是在Linux环境下的DinD上。我的代码如下:

测试用例/简单测试用例

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

def createCase = "Page_TIP/create case"
findTestObject(createCase + '/btn_next')
findTestObject(createCase + '/invalid URL')

def home = "Page_TIP/Home"
findTestObject(home + '/btn_create')
findTestObject(home + '/btn_search')
findTestObject(home + '/Home Page')
findTestObject(home + '/href_pagination')

登录

--------------------------------------------------------------------------------
Test Suites/simple test case - Chrome - 20181211_061916..................0/1(0%)
--------------------------------------------------------------------------------

Request sent successfully.
12-11-2018 06:19:18 AM - [START]  - Start Test Suite : Test Suites/simple test case
12-11-2018 06:19:19 AM - [RUN_DATA] - Logging run data 'hostName' with value 'root - runner-d5d788d9-project-1096-concurrent-0'
12-11-2018 06:19:19 AM - [RUN_DATA] - Logging run data 'os' with value 'Linux 64bit'
12-11-2018 06:19:19 AM - [RUN_DATA] - Logging run data 'hostAddress' with value '172.17.0.3'
12-11-2018 06:19:19 AM - [RUN_DATA] - Logging run data 'katalonVersion' with value '5.7.1.1'
12-11-2018 06:19:19 AM - [START]  - Start Test Case : Test Cases/Find test objects
12-11-2018 06:19:19 AM - [INFO]   - Evaluating variables for test case
12-11-2018 06:19:20 AM - [START]  - Start action : Statement - createCase = "Page_TIP/create case"
12-11-2018 06:19:20 AM - [END]    - End action : Statement - createCase = "Page_TIP/create case"
12-11-2018 06:19:20 AM - [START]  - Start action : Statement - com.kms.katalon.core.testobject.ObjectRepository.findTestObject((createCase + /btn_next))
12-11-2018 06:19:20 AM - [INFO]   - Finding Test Object with id 'Object Repository/Page_TIP/create case/btn_next'
12-11-2018 06:19:20 AM - [END]    - End action : Statement - com.kms.katalon.core.testobject.ObjectRepository.findTestObject((createCase + /btn_next))
12-11-2018 06:19:20 AM - [START]  - Start action : Statement - com.kms.katalon.core.testobject.ObjectRepository.findTestObject((createCase + /invalid URL))
12-11-2018 06:19:20 AM - [INFO]   - Finding Test Object with id 'Object Repository/Page_TIP/create case/invalid URL'
12-11-2018 06:19:20 AM - [WARNING] - Test object with id 'Object Repository/Page_TIP/create case/invalid URL' does not exist
12-11-2018 06:19:20 AM - [END]    - End action : Statement - com.kms.katalon.core.testobject.ObjectRepository.findTestObject((createCase + /invalid URL))
12-11-2018 06:19:20 AM - [START]  - Start action : Statement - home = "Page_TIP/Home"
12-11-2018 06:19:20 AM - [END]    - End action : Statement - home = "Page_TIP/Home"
12-11-2018 06:19:20 AM - [START]  - Start action : Statement - com.kms.katalon.core.testobject.ObjectRepository.findTestObject((home + /btn_create))
12-11-2018 06:19:20 AM - [INFO]   - Finding Test Object with id 'Object Repository/Page_TIP/Home/btn_create'
12-11-2018 06:19:20 AM - [WARNING] - Test object with id 'Object Repository/Page_TIP/Home/btn_create' does not exist
12-11-2018 06:19:20 AM - [END]    - End action : Statement - com.kms.katalon.core.testobject.ObjectRepository.findTestObject((home + /btn_create))
12-11-2018 06:19:20 AM - [START]  - Start action : Statement - com.kms.katalon.core.testobject.ObjectRepository.findTestObject((home + /btn_search))
12-11-2018 06:19:20 AM - [INFO]   - Finding Test Object with id 'Object Repository/Page_TIP/Home/btn_search'
12-11-2018 06:19:20 AM - [WARNING] - Test object with id 'Object Repository/Page_TIP/Home/btn_search' does not exist
12-11-2018 06:19:20 AM - [END]    - End action : Statement - com.kms.katalon.core.testobject.ObjectRepository.findTestObject((home + /btn_search))
12-11-2018 06:19:20 AM - [START]  - Start action : Statement - com.kms.katalon.core.testobject.ObjectRepository.findTestObject((home + /Home Page))
12-11-2018 06:19:20 AM - [INFO]   - Finding Test Object with id 'Object Repository/Page_TIP/Home/Home Page'
12-11-2018 06:19:20 AM - [WARNING] - Test object with id 'Object Repository/Page_TIP/Home/Home Page' does not exist
12-11-2018 06:19:20 AM - [END]    - End action : Statement - com.kms.katalon.core.testobject.ObjectRepository.findTestObject((home + /Home Page))
12-11-2018 06:19:20 AM - [START]  - Start action : Statement - com.kms.katalon.core.testobject.ObjectRepository.findTestObject((home + /href_pagination))
12-11-2018 06:19:20 AM - [INFO]   - Finding Test Object with id 'Object Repository/Page_TIP/Home/href_pagination'
12-11-2018 06:19:20 AM - [WARNING] - Test object with id 'Object Repository/Page_TIP/Home/href_pagination' does not exist
12-11-2018 06:19:20 AM - [END]    - End action : Statement - com.kms.katalon.core.testobject.ObjectRepository.findTestObject((home + /href_pagination))
12-11-2018 06:19:20 AM - [PASSED] - Test Cases/Find test objects
12-11-2018 06:19:20 AM - [END]    - End Test Case : Test Cases/Find test objects
12-11-2018 06:19:20 AM - [END]    - End Test Suite : Test Suites/simple test case
Copying report to folder /root/report...

--------------------------------------------------------------------------------
Test Suites/simple test case - Chrome - 20181211_061916................1/1(100%)
--------------------------------------------------------------------------------

最后,在“测试套件”中添加“简单测试用例”。

我该如何解决?

编辑:更新测试脚本并添加错误消息

0 个答案:

没有答案