Unable to locate the dataset in a compound test
When you play back a compound test that contains a functional test script associated with a dataset, the playback fails.
Cause
HCL OneTest™ UI fails to locate the path of the dataset because the dataset path changes when the associated script is part of a compound test, and as a result, the playback fails.
Resolution
You must add the following code to the functional test script to retrieve the correct
path of the dataset:
String cursorId= "differentTestCursor";
Cursor cursorOptions = Cursor.builder()
.cursorId(cursorId)
.accessMode(AccessModeEnum.OVERWRITE)
.fetchMode(FetchModeEnum.SEQUENTIAL)
.shareMode(ShareModeEnum.SHARED)
.lastActive(null)
.wrap(true)
.build();
String projectPath = OptionManager.getString(IOptionName.DATASTORE);
Path path= Paths.get(projectPath,"<Dataset_Filename.csv>");
String DatasetPath=path.toAbsolutePath().toString();
logInfo("DatasetPath :" + DatasetPath);
String DatasetEncodedPath = Base64.getEncoder().encodeToString(DatasetPath.getBytes());
System.out.println(DatasetEncodedPath);
System.out.println("Original Customr ID : "+cursorOptions.getCursorId());
DatasetCursor createdCursor= CursorFactory.getWorkbenchDatasetCursor("localhost", 7081, DatasetEncodedPath, cursorOptions);
logInfo("Intial Cursor : "+createdCursor.toString()+" Cursor ID "+createdCursor.getCursorOptions().getCursorId());
createdCursor.deleteCursor(false);
sleep(10);