cancel
Showing results for 
Search instead for 
Did you mean: 

OnLogError Sender Returning Null Value, Updated to X64 for TestComplete and Office 2016

SOLVED
Don
Contributor

OnLogError Sender Returning Null Value, Updated to X64 for TestComplete and Office 2016

Hello Community,

 

I recently upgraded to the new TestComplete 12.42 which has x64 bit support. Because TC automatically installs x64 support, I installed Office 2016 with AccessDatabase 2016 both which are x64. 

 

Now every time I have an error when the GeneralEvents_OnLogError(Sender, LogParams) is called, it returns a null value. I tried testing it with the 32bit versions in other machines and they return the value with no problems.

 

I tried Installing AccessDatabase for 2016, 2010, 2013 and it's still giving me the same issue. I also changed the calls from

Microsoft.ACE.OLEDB.12.0 to Microsoft.ACE.OLEDB.16, Microsoft.ACE.OLEDB.15, Microsoft.ACE.OLEDB.14, etc.

 

The tests run fine, it's only when I get an error with the OnLogError where I'm having issues. Does anyone know if I have to change something somewhere in the settings, I tried looking and still no luck.

 

I even looked into the GeneralEvents and looked at the OnLogError but still cannot find the issue.

 

Any help is appreciated.

 

Regards

1 ACCEPTED SOLUTION

Accepted Solutions
Don
Contributor

Re: OnLogError Sender Returning Null Value, Updated to X64 for TestComplete and Office 2016

Ok So I may have found the solution.

 

First I uninstalled the latest version of testcomplete and did a complete uninstall of office 2016. I then installed office 16, followed by Access Database 2010 followed by an older version of testcomplete. I then upgraded to the latest version.

 

I also removed the excel code within the onLogError code. This excel code was there so it can write to the excel sheet the problem that occurred during the run. By removing it I won't be able to see why the run failed but I will still see that it failed. I will have to find a new solution for this but this is better than not having my tests work at all when doing a regression run.

 

One last note. I installed only 32 bit version of office and access database. I am also using the 32bit version of TestComplete instead of the 64 bit. 

 

Thanks to everyone who replied to this post. I will continue to update if needed with any new findings.

 

I hope this helps anyone running into a similar issue.

View solution in original post

16 REPLIES 16
Marsha_R
Community Hero

Re: OnLogError Sender Returning Null Value, Updated to X64 for TestComplete and Office 2016

I would contact Support directly for this one.  You can use this link:

https://support.smartbear.com/message/?prod=TestComplete

Don
Contributor

Re: OnLogError Sender Returning Null Value, Updated to X64 for TestComplete and Office 2016

Thanks marsha, I'll go ahead and contact support. In the meantime if anyone else has a solution please post. 🙂

tristaanogre
Community Hero

Re: OnLogError Sender Returning Null Value, Updated to X64 for TestComplete and Office 2016

What is in your OnLogError event handler code?  It might be helpful to see what's being executed there to determine what other changes might need to be done.

 

Additionally, while by default TestComplete runs in 64 bit, you can still access a 32-bit version.  Typically installed in C:\Program Files (x86)\SmartBear\TestComplete 12\Bin\


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Don
Contributor

Re: OnLogError Sender Returning Null Value, Updated to X64 for TestComplete and Office 2016

Thanks for the info about accessing the 32bit version. I am already fully invested in the 64 bit version and if I can't find a solution I will uninstall everything and reinstall it with the 32bit version

 

Here is the code that I am using. It works fine with the 32 bit version that I haven't updated but like mentioned in the main post the 64 bit doesn't send the Sender value.

 

 

function GeneralEvents_OnLogError(Sender, LogParams){
//  Log.Message(Sender);
  if (driver == true){
  Log.Message(typeof runSheet);
  var type = typeof runSheet;
  if(String(runSheet.cells(loopCounter,2)).search("AD_") == 0) {
  excel_library.quitExcel();
//    eval("excel_library.quitExcel()");
  }
  handlingRecursiveCallPopup();

 

 

tristaanogre
Community Hero

Re: OnLogError Sender Returning Null Value, Updated to X64 for TestComplete and Office 2016

I think you misunderstood... you don't need to re-install anything... the 32-bit version is installed already along with the 64-bit version.  You just need to run from a different directory.  I would try that and see if that works for you.

 

In any case, I'm not sure the "Sender" is something generally accessible and usable.  If it's returning a "null" value, then it's probably because there's nothing there for you to access in the way of Log.Message.  I'm assuming, from your original post, that is what the problem is, that the Log.Message(Sender) line is not functioning?

 

I see some code in there referencing Excel, some object called "runSheet" and a library of excel_library.  Could share that code as well?  It's possible that something needs updated in there to use the 64-bit drivers.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Don
Contributor

Re: OnLogError Sender Returning Null Value, Updated to X64 for TestComplete and Office 2016

That code that I use is the same code I'm using in the non Updated Version and it works fine. When I debug the code I see that Sender has values in the other machine that has the 32bit Software while the computer with the 64bit sends null.

 

Im uploading some code from the Excel_library which is on a different script page.

 

function readData(filePath,sheetname,rowNum){         
  getData(filePath);     
  var sheet = wb.Worksheets(sheetname);                       
  var colCount = sheet.usedrange.columns.count;
  dataArray=[];                    
  for (i=2;i<=colCount;i++) {
    dataArray.push(sheet.cells(rowNum,i).value);                       
  }
  wb.close();
  xl.Application.Quit();
  return dataArray;
}

As for RunSheet that is just a globalVariable at the top.

 

tristaanogre
Community Hero

Re: OnLogError Sender Returning Null Value, Updated to X64 for TestComplete and Office 2016

What is the purpose of Log.Message(Sender)?  Why is it needed?  That's kind of an internal item to TestComplete in most cases.

 

If that is the problem, then it's probably not at all related to your version of Office or your excel drivers or anything but simply a change in the latest version.  Again, try running the 32-bit copy of the updated version and see if the problem persists... SPECIFICALLY, the 32-bit copy of the updated version.  If the problem doesn't manifest in that 32-bit copy, then we know it's something with the 64-bit version. If the problem DOES manifest in that 32-bit copy, then we know that there's something overall different in the updated version (regardless of bitness) that makes Log.Message(Sender) not act as it did before.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Don
Contributor

Re: OnLogError Sender Returning Null Value, Updated to X64 for TestComplete and Office 2016

Thank you that response actually made me realize that it could be an issue with the 64bit version. Let me try the 32bit and i'll update the post.

tristaanogre
Community Hero

Re: OnLogError Sender Returning Null Value, Updated to X64 for TestComplete and Office 2016

Just an FYI, "Sender" is an object... Log.Message takes a string as a parameter.  So, to put the object in that string parameter, TestComplete is going to attempt to do some sort of conversion to string of the object.  It's entirely possible that, in TC version 12.42 that the "Sender" object does not convert nicely to a string, hence the "NULL" value.  It may have worked for you in the past... but that may have been just an odd matter of luck.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
New Here?
Join us and watch the welcome video:
Top Kudoed Authors