TestProject Forum

Error running github test from cli

Hello,

I’m getting the following error when trying to run a test from github (synced by the github plugin):

Processing execution...
Execution failed: Failed converting backup package to an Execution Package.
Check that your backup package is valid and try again.
> �MismatchedInputException: Cannot construct instance of `io.testproject.agent.dto.classes.execution.backup.BackupElement` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('o0')
 at [Source: (File); line: 7342, column: 3] (through reference chain: io.testproject.agent.dto.classes.execution.backup.BackupPackage["elements"]->java.util.ArrayList[11])

The command line used was

testproject-agent run -rd -p parameters-qa1.csv --browser=CHROME -o /tmp/ /home/qa/qa-automation/tptests/test.yaml

The error seems to be triggered by the presence of anchors in the generated yaml file, if i manually edit the yaml and remove the anchors the test run works.

A scenario to reproduce the presence of the anchors is to create a test which calls 2 sub tests, module1 and module2, module1 calls module2 again and they both contain the same element. This causes the generated yaml to contain an anchor to that element present in both the subtests

Example yaml file:

id: 5ayNaO5eTkygy12Gk0x5xg
projectId: M4Yf23kqskif8JltpZsGDg
projectName: MyProject
created: 2022-01-11T09:44:23.3363283Z
protocol: 1
tests:
- id: ewgPrV_zsU-vFCbEh1xqXQ
  name: test_tp_bug
  description: ''
  platform: Web
  type: Web
  driverType: Chrome
  version: 0.1
  creationDate: 2022-01-10T15:51:22.0000000
  modificationDate: 2022-01-11T09:30:04.0000000
  settings:
    automationAssistant: true
    appId: NIFntw5nBUSCZFrQC7WIOQ
    stepSleepTime: 500
    stepTimeout: 15000
    stepSleepTiming: Before
    stepFailureBehaviorType: Abort
    stepTakeScreenshotConditionType: Failure
  application:
    id: NIFntw5nBUSCZFrQC7WIOQ
    name: qa1
    url: https://google.com/
    platform: Web
  steps:
  - id: nL7IRJa25kmevKyro1O29A
    comments: Navigates the specified URL (Auto-generated)
    enabled: true
    invertResult: false
    order: 1
    repeat: 1
    type: Action
    settings:
      sleepTime: -1
      timeout: -1
      sleepTiming: Inherit
      failureBehaviorType: Inherit
      takeScreenshotConditionType: Inherit
    action:
      id: 49c5d8d8-4ba8-42f0-823d-702e6acfb23a
      source: System
    parameterMaps:
    - name: url
      value: '{{ApplicationURL}}'
      direction: Input
    conditions: []
    validations: []
    contexts: []
  - id: HcLFmCjhvkiyPyZ_5NmYGg
    comments: ''
    enabled: true
    invertResult: false
    order: 2
    repeat: 1
    type: Test
    targetTestId: w0DVVX9PB0yZ8jMQdHQNmg
    settings:
      sleepTime: -1
      timeout: -1
      sleepTiming: Inherit
      failureBehaviorType: Inherit
      takeScreenshotConditionType: Inherit
    action:
      source: None
    parameterMaps:
    - name: ApplicationURL
      value: '{{ApplicationURL}}'
      direction: Input
    conditions: []
    validations: []
    contexts: []
  - id: 9oYhJZjvE0-lVZ5e1eXprg
    comments: ''
    enabled: true
    invertResult: false
    order: 3
    repeat: 1
    type: Test
    targetTestId: EIh217G1UUWFDnc6K4MkOw
    settings:
      sleepTime: -1
      timeout: -1
      sleepTiming: Inherit
      failureBehaviorType: Inherit
      takeScreenshotConditionType: Inherit
    action:
      source: None
    parameterMaps:
    - name: ApplicationURL
      value: '{{ApplicationURL}}'
      direction: Input
    conditions: []
    validations: []
    contexts: []
  parameters:
  - name: ApplicationURL
    description: Auto generated application URL parameter
    value: https://google.com/
    type: Input
auxTests:
- id: w0DVVX9PB0yZ8jMQdHQNmg
  name: test_tp_bug_module1
  description: ''
  platform: Web
  type: Web
  driverType: Chrome
  version: 0.1
  creationDate: 2022-01-11T09:25:00.0000000
  modificationDate: 2022-01-11T09:28:47.0000000
  settings:
    automationAssistant: true
    appId: NIFntw5nBUSCZFrQC7WIOQ
    stepSleepTime: 500
    stepTimeout: 15000
    stepSleepTiming: Before
    stepFailureBehaviorType: Abort
    stepTakeScreenshotConditionType: Failure
  steps:
  - id: ayTi65yxrEatHFKoAz5j0Q
    comments: Navigates the specified URL (Auto-generated)
    enabled: true
    invertResult: false
    order: 1
    repeat: 1
    type: Action
    settings:
      sleepTime: -1
      timeout: -1
      sleepTiming: Inherit
      failureBehaviorType: Inherit
      takeScreenshotConditionType: Inherit
    action:
      id: 49c5d8d8-4ba8-42f0-823d-702e6acfb23a
      source: System
    parameterMaps:
    - name: url
      value: '{{ApplicationURL}}'
      direction: Input
    conditions: []
    validations: []
    contexts: []
  - id: 0YLTSWc8xkO_NMWq2FSokg
    comments: ''
    enabled: true
    invertResult: false
    order: 2
    repeat: 1
    type: Action
    elementId: LlZ_DoWQtUO2W4Eg_l1wqg
    settings:
      sleepTime: -1
      timeout: -1
      sleepTiming: Inherit
      failureBehaviorType: Inherit
      takeScreenshotConditionType: Inherit
    action:
      id: 02d572b2-d610-4700-9ad3-40076ddb9807
      source: System
    parameterMaps: []
    conditions: []
    validations: []
    contexts: []
  parameters:
  - name: ApplicationURL
    description: Auto generated application URL parameter
    value: https://google.com/
    type: Input
- id: EIh217G1UUWFDnc6K4MkOw
  name: test_tp_bug_module2
  description: ''
  platform: Web
  type: Web
  driverType: Chrome
  version: 0.1
  creationDate: 2022-01-11T09:28:59.0000000
  modificationDate: 2022-01-11T09:44:20.0000000
  settings:
    automationAssistant: true
    appId: NIFntw5nBUSCZFrQC7WIOQ
    stepSleepTime: 500
    stepTimeout: 15000
    stepSleepTiming: Before
    stepFailureBehaviorType: Abort
    stepTakeScreenshotConditionType: Failure
  steps:
  - id: OwkHqY22iEeXjYpjbUk9Cg
    comments: Navigates the specified URL (Auto-generated)
    enabled: true
    invertResult: false
    order: 1
    repeat: 1
    type: Action
    settings:
      sleepTime: -1
      timeout: -1
      sleepTiming: Inherit
      failureBehaviorType: Inherit
      takeScreenshotConditionType: Inherit
    action:
      id: 49c5d8d8-4ba8-42f0-823d-702e6acfb23a
      source: System
    parameterMaps:
    - name: url
      value: '{{ApplicationURL}}'
      direction: Input
    conditions: []
    validations: []
    contexts: []
  - id: tze8cPwFTk6DknE0P_EF8A
    comments: ''
    enabled: true
    invertResult: false
    order: 2
    repeat: 1
    type: Action
    elementId: LlZ_DoWQtUO2W4Eg_l1wqg
    settings:
      sleepTime: -1
      timeout: -1
      sleepTiming: Inherit
      failureBehaviorType: Inherit
      takeScreenshotConditionType: Inherit
    action:
      id: 02d572b2-d610-4700-9ad3-40076ddb9807
      source: System
    parameterMaps: []
    conditions: []
    validations: []
    contexts: []
  - id: YTNdBmWbSkCZC-YPH9isTA
    comments: ''
    enabled: true
    invertResult: false
    order: 3
    repeat: 1
    type: Test
    targetTestId: w0DVVX9PB0yZ8jMQdHQNmg
    settings:
      sleepTime: -1
      timeout: -1
      sleepTiming: Inherit
      failureBehaviorType: Inherit
      takeScreenshotConditionType: Inherit
    action:
      source: None
    parameterMaps:
    - name: ApplicationURL
      value: '{{ApplicationURL}}'
      direction: Input
    conditions: []
    validations: []
    contexts: []
  parameters:
  - name: ApplicationURL
    description: Auto generated application URL parameter
    value: https://google.com/
    type: Input
elements:
- &o0
  id: LlZ_DoWQtUO2W4Eg_l1wqg
  name: TestTPBug
  description: ''
  type:
    id: jUwODgyNjAyNzk2NTk1NDM
    name: Generic Web Element
    source: System
  locators:
  - name: XPATH
    value: //div
    priority: 0
- *o0
- *o0
projectParameters: []
addons: []

Hi @SjakieMaksym,
Can you please copy the share link of this test and send the link to our support mail
support@testproject.io