Ask a Question

Object causing exception during test run

SOLVED
ThomasCasserly
Contributor

Object causing exception during test run

Hi all, 

 

I'm having an issue running a test where an object is continually causing an exception. 

 

The object can be found by clicking the "Highlight" option from the right click menu from the Namemapping tree. So appear no issues with the mapping.

I have added a waitproperty operation to the test ,to wait until the object exists, the exception still occurs on the object.

I have added a delay to the test to allow the object to load, the object still causes an exception.

I have added interactions  with other page objects on the same webpage to the test, before interacting with the required object,  object still causes an exception.

 

In the keyword test log, "Details", the only message I am getting is "Member not found"

 

Any ideas on this? is there a remedy for it?


Thanks

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ThomasCasserly
Contributor

Re: Object causing exception during test run

Ok, 

 

So i just found the problem myself, I hadn't selected the "Exists" property of the Object, but had only selected the object itself.

Once I Selected the Object, and set the "Exists" property as the value the Exception no longer occurs.

 

User error this time (must be the first time ever 😋😅😅)

 

Thanks all for pointing me in the right direction and helping me find "my own" issue🙈🙈🙈

View solution in original post

13 REPLIES 13
mikef
Staff

Re: Object causing exception during test run

Hi @ThomasCasserly 

 

It sounds like may be some dynamic attribute being used in the identification properties of the object, which could be fixed by using a wildcard or regex - or editing to use some other attribute(s) for that object. You can check this in the NameMapping selectors.

AlexKaras
Community Hero

Re: Object causing exception during test run

Hi,

 

In the keyword test log, "Details", the only message I am getting is "Member not found"

What is the code line that causes error?

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
ThomasCasserly
Contributor

Re: Object causing exception during test run

Hi Alex, 

 

I have no idea, how would I find it? FYI I'm using keyword tests in case that makes a difference.

AlexKaras
Community Hero

Re: Object causing exception during test run

 I'm using keyword tests

Then a screenshot of the operation that causes the error along with operation's parameters.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
Marsha_R
Community Hero

Re: Object causing exception during test run

If you click on the error message in the log, it will take you to the line in your test that causes the error.
ThomasCasserly
Contributor

Re: Object causing exception during test run

Hi Mike, 

thanks for the suggestion Mike but the object mapping doesn't contain any dynamic properties. 

ThomasCasserly
Contributor

Re: Object causing exception during test run

Hi Alex, screenshot is attached.

Could it be the length of the PropertyName and PropertyValue? 

Just noticing that they are quite long. I'm not aware of any character limit but just jumped out as a possibility,

 

Thanks

ThomasCasserly
Contributor

Re: Object causing exception during test run

Thanks Marsha,

 

 Was already aware of this, but I appreciate the suggestion.👍

AlexKaras
Community Hero

Re: Object causing exception during test run

Hi,

 

Initial note: it is my guess that there is no exception, but just the 'Object not found' error. Am I correct?

 

Could it be the length of the PropertyName and PropertyValue? 

Not the length, but parameters themselves.

Basically, your code is like this:

a.b.c.WaitProperty(a.b.c, a.b.c.Exists, -1);

which in human language means: for object a.b.c get its property a.b.c and infinitely wait until this property will get value of a.b.c.Exists.

Notes:

a) In order for .WaitProperty to be callable, all its parent objects (a, b and c) must exist. If any of them does not exist one will get the 'Object not found' error in test log with the specification what object did not exist;

b) a.b.c resolves to object, but you are trying to use it as a string parameter that specifies the name of the property you are waiting for;

c) a.b.c.Exists resolves to either True or False, but you are trying to use it as a value parameter. So, depending of whether or not object c exists, your code will wait for the property to become equal to either True or False.

 

Technically, this piece of code might look like this:

a.b.c.WaitProperty('Exists', true, -1) // wait infinitely until for the object c the value of Exists property becomes equal to true

but note that this code will work only if object a and object b and object c, all of them do exist. Otherwise this code will fail with the 'Object not found' error.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
cancel
Showing results for 
Search instead for 
Did you mean: