Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..
128 views

Migrating from 14.53 to UFT 15.0 - Existing scripts won't run

Hello,

I'm currently using UFT 14.53 to automate tests on a Java application.

I installed UFT 15.00 on one of the machines in order to test the current scripts on the new version but the scripts won't run. Right aways, I get an error "The calling thread cannot access this object because a different thread owns it".

This error occurs when i try to add a parameter to the global sheet using the AddParameter function. By itself, it works fine, meaning if I write a few lines of code just to save a value to the global sheet, it works fine.

The problem occurs when I run an existing script which starts by loading all the required data sheets before saving some values to the global sheet. In the function used to load the data sheets, it also sets the global sheet current row to the test iteration number and somehow that causes the problem but I cannot figure out why. 

Basically, the script looks like this:

LoadDataSheet(...)

... code that uses the AddParameter function

dtTable.AddParameter sParameterName, ""    => Error occurs on this line of code
dtTable.SetCurrentRow iRow        
dtTable.GetParameter(sParameterName).value = sParameterValue


Function LoadDataSheet(..)

.... code to load the data sheets

Set gbData = DataTable.GlobalSheet
gbData.SetCurrentRow  Environment("TestIteration")

End Function

If I comment out the last two lines, the error disappears. 

Has anyone run into a similar problem? Maybe it's not very clear what I'm trying to explain ...

Thanks

0 Likes
0 Replies
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.