Forum Discussion

paulie's avatar
paulie
Occasional Contributor
10 years ago

Rename TestCase - call to script library fails

Is there a known issue with renaming TestCases?
When I rename a TestCase the last line below always fails.
If I clone a TestCase and rename the cloned TC in the Clone TestCase dialog the code works as per usual.
The cloned TC/renamed TC are in a different Testsuite to the Library scripts

// Get a reference to the library TestSuite 
library = testRunner.testCase.testSuite.project.testSuites["Library"]
assert library != null

// Find the modules within the library
memberModule = library.testCases["All_methods"].testSteps["Members"]
assert memberModule != null

// Initialise the library - places instances in the context
memberModule.run(testRunner, context)

// get the instances from the context.
def myMembers = context.Members
assert myMembers != null

1 Reply

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    I am not aware of an existing issue. Is 'Members' supposed to be method in "context.Members" or are you retrieving a context variable?
    I suggest you save your project after you clone or rename the TestCase, before you run it. Please note that you will need to reconfigure DataSink/DataSource test steps.

    Regards,

    Giscard
    SmartBear Support