This is a migrated thread and some comments may be shown as answers.

How to verify object not visible

1 Answer 104 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dev
Top achievements
Rank 1
Dev asked on 19 Jan 2011, 09:44 AM
Hi Team,
               Im having an issue related to the verification of invisibility of an object.Webaii has a in-built feature Isvisible(),but when i use it in NameofObject.Isvisible property the script fails with the error "object reference not set to an instant of the object".

I have to verify the checkpoint that the object is not visible,please tell me how to do this.

Thanks

Regards
Dev

1 Answer, 1 is accepted

Sort by
0
Stoich
Telerik team
answered on 20 Jan 2011, 10:48 AM
Hello Dev,
   the error you get:
"object reference not set to an instant of the object".
is not related specifically to the isvisible field. Rather this error tells you that in the statement NameofObject.Isvisible NameofObject doesn't point to any object.

Please check whether the logic you use to assign an object to NameofObject. Put a something like this in your code in the line before you try to access isvisible:
if (NameofObject == null ) {
Log.WriteLine("NameofObject doesn't point to an object");
}
Then check the log.  You'll probably need to revise the Find Logic for NameofObject to resolve this issue.

I hope this helps, hope to hear from you soon!

Best wishes,
Stoich
the Telerik team
Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
Tags
General Discussions
Asked by
Dev
Top achievements
Rank 1
Answers by
Stoich
Telerik team
Share this question
or