Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object reference not set to an instance of an object #17

Open
Zitrax opened this issue Jul 17, 2015 · 8 comments
Open

Object reference not set to an instance of an object #17

Zitrax opened this issue Jul 17, 2015 · 8 comments

Comments

@Zitrax
Copy link
Contributor

Zitrax commented Jul 17, 2015

While working on #15 I noticed the error in the title of this issue when I built from master. The latest binary using installer 4.0.0 did not show that error.

This happens when I do a call to: ldtp.selectitem(...).

I ran a bisect and got this:

There are only 'skip'ped commits left to test.
The first bad commit could be any of:
3a912d3
ef33a26
99732f5
We cannot bisect more!

Two of those commits didn't build that's why it only narrowed it down to three.

@Zitrax
Copy link
Contributor Author

Zitrax commented Jul 17, 2015

The actual traceback:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files (x86)\VMware\CobraWinLDTP\ldtp\client.py", line 72, in __call__
    return self.__send(self.__name, args)
  File "C:\Python27\lib\xmlrpclib.py", line 1599, in __request
    verbose=self.__verbose
  File "C:\Program Files (x86)\VMware\CobraWinLDTP\ldtp\client.py", line 193, in request
    raise LdtpExecutionError(e.faultString.encode('utf-8'))
ldtp.client_exception.LdtpExecutionError: Unhandled exception: Object reference not set to an instance of an object.

@nagappan
Copy link
Member

Can you try this ?

In a terminal:
set LDTP_DEBUG=1
cobrawinldtp.exe

From python prompt:

ldtp.selectitem(...)

You can find the traces on first console why it failed. Thanks

@Zitrax
Copy link
Contributor Author

Zitrax commented Jul 17, 2015

Log ends with:

:InternalGetObjectHandle: Child handle NULL
:System.NullReferenceException: Object reference not set to an instance of an object.
   at Ldtpd.Combobox.InternalComboHandler(String windowName, String objName, String item, String& selectedItem, String a
ctionType, ArrayList childList)

So although the rest of the log did not immediately tell me anything this points to Combobox.cs, the only commit of the three above that touches it is ef33a26, and indeed if I revert that single commit it works again.

@Zitrax
Copy link
Contributor Author

Zitrax commented Jul 17, 2015

I think I see the issue, that commit used comboTtype on line 262. Changing that to type solves my problem. I can submit a pull request for that.

Zitrax added a commit to Zitrax/cobra that referenced this issue Jul 17, 2015
@nagappan
Copy link
Member

Great thanks checking.

nagappan added a commit that referenced this issue Jul 17, 2015
Fix selectitem(...). Fixing issue #17.
@Zitrax Zitrax closed this as completed Jul 17, 2015
@Zitrax
Copy link
Contributor Author

Zitrax commented Jul 27, 2015

By the way is there any plan on adding a new binary release ? The last one seem to be from Nov 2013.

@Zitrax
Copy link
Contributor Author

Zitrax commented Jul 27, 2015

And unfortunately it turns out my patch above did not really solve this problem - I must have missed something since the problem reappeared now. I tried to reproduce again, and it was definitely the introduced in the earlier mentioned commit.

Further trying to narrow it down showed that it was a LogMessage call this time that seemed to cause this:

LogMessage("elementItem: " + elementItem.Current.Name +
                    " - " + elementItem.Current.ControlType.ProgrammaticName);

it also happens if I replace that log call with anything that use elementItem.Current. Seem a bit odd, but as of now I can reproduce this consistently, comment out those two lines and it works put them back again and it fails. So either the use of that has some direct side effect or there is something weirder going on like a timing issue.

Any ideas ?

@Zitrax Zitrax reopened this Jul 28, 2015
@stilok2
Copy link

stilok2 commented Oct 12, 2017

I'm getting this error while using getcombovalue method.
Traceback (most recent call last):
File "", line 1, in
File "C:\Program Files (x86)\VMware\CobraWinLDTP\ldtp\client.py", line 73, in call
return self.__send(self.__name, args)
File "C:\Python27\lib\xmlrpclib.py", line 1602, in __request
verbose=self.__verbose
File "C:\Program Files (x86)\VMware\CobraWinLDTP\ldtp\client.py", line 194, in request
raise LdtpExecutionError(e.faultString.encode('utf-8'))
ldtp.client_exception.LdtpExecutionError: Unhandled exception: Object reference not set to an instance of an object.

Has this been resolved? Or am I pointing to the wrong binary? Thanks for the help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants