TestProject Forum

Importing TestProjects scripts

Hi Team,
Please help on below points,

  1. Is it possible to export the TestProject recorded script?
  2. is it possible to export multiple recorded script at a time ?
  3. is it possible to import the exported scripts into the existing Selenium+TestNG project ?

-Naveen.

Hello @naveen.a

  1. You can export recorded tests as YAML file, and run it with the CLI locallyimage
    TestProject Agent CLI - TestProject Documentation

  2. You can export recorded tests to JUnit + Gradle
    image


    GitHub - testproject-io/java-opensdk: TestProject Java OpenSDK

  3. Since exporting recorded tests is done in JUnit and Gradle, you can first convert your generate gradle project using the maven plugin for Gradle:

In the generate build.gradle add
id 'maven'
Inside plugins

plugins {
    id 'java'
    id 'maven'
}

Now in others, you will have an ‘install’ task:

image

After you run it, it will generate a pom.xml file that represents the build.gradle

image

Afterwards, just add the TestNG dependency, and you are good to go.
https://mvnrepository.com/artifact/org.testng/testng

In the near future we will add the ability to generate for Maven and TestNG as well.

Is there a functionality to import back in the Cloud UI a test that was previously exported ?

can you clarify if you referring importing back YAML test or coded test?

Hi, Is it possible to import back YAML and not Coded test or vice versa ? I tried both but I was not able to find a way to import neither YAML nor coded test.
Thanks

For YAML, it’s relay simple since it’s a text based , just click on open file and then import test

For coded test you need to package and upload JAR/DLL files first , then upload it via create new test

Thanks for the prompt feedback, I just have an additional question, I see the import as JAML requires to enter a single YAML file, while in the zip file generated by the “Save as file” export functionality 3 YAML files are available, package, project-parameters, settings. Can you confirm the YAML file to be used in the import functionality is the package.yaml. Thanks

Hi @mbertol4. You are correct. Importing the package.yaml will result in a recorded test based on the YAML. The project-parameters and settings files are there to make it easier to configure everything when executing using the TestProject Agent CLI. If your test is using project parameters, they are already incorporated in the package file so when you import, any missing parameters will be created in your project.