TestProject Forum

Is there a way to use output parameters in open-sdk?

Dear Support

I made coded ParameterizedTest using JUnit5 like → java-opensdk/ParameterizedExampleTest

// https://github.com/testproject-io/java-opensdk/blob/master/src/test/java/io/testproject/sdk/tests/examples/frameworks/junit5/ParameterizedExampleTest.java
@ParameterizedTest
@DisplayName("Example Login Test (Parameterized)") 
@ArgumentsSource(TestProjectParameterizer.class)
void testExample(final String name) {
    driver.navigate().to("https://example.testproject.io/");
    driver.findElement(By.cssSelector("#name")).sendKeys(name);
    driver.findElement(By.cssSelector("#password")).sendKeys("1234

I want to use this test output as input parameter for other test.


In legacy-sdk(v1 - java), the parameter direction could be set using test annotations.

@Parameter(
    description = "Contains the number of actual search results",
    direction = ParameterDirection.OUTPUT
)

document: testproject-sdk-v1/java-sdk#test-annotations


But in open-sdk(v2 - java), i couldn’t find information about the output parameters.
There was only input parameter information.

@ArgumentsSource(TestProjectParameterizer.class)

document: java-opensdk#uploading-parameterized-tests


My question

  • Is there a way to use output parameters as input parameter for other test in open-sdk(ex. JUnit5)?
  • Is legacy SDK the only way to use the output parameter in now (coded test)?

I resolved this problem using generate code feature