Ask a Question

I am trying to get a property of a object like IsEnabled but not getting it

Varunawasthi
Occasional Contributor

I am trying to get a property of a object like IsEnabled but not getting it

Hi have a scenario in which in Desktop Application I have to Open an account and for that account by default there are few buttons which I have to check are those Enable or Disable and then for that same account will change View and have to check same buttons are those enable or disable or not.

 

The issue I am encountering is the Object properties is not refreshing.

 

 

Like in default View its Enabled and its True but when I changed its false but its not working for second one its taking same first times properties only.

 

 

what I have used is Sys.refresh, Object.Refresh() both didn't worked wat should I do please guide?

5 REPLIES 5
NisHera
Valued Contributor

probably your application takes time to change property.

But testcompleate is generally faster than applications under test.

you try waiting some time.  adding delay method or better wait property method

Varunawasthi
Occasional Contributor

Hi

 

Thanks for reply, However I have already put delay of 10s but still its the same issue, any other suggestions ?

 

 

 

 

If the mapped object is the same, there is a caching of the objects that happens.  Try 

 

ObjectName.RefreshMappingInfo()


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
Varunawasthi
Occasional Contributor

Thanks, but is there other way reason I am getting properties in array and identifying the object and its not working.

Please share your code.  That will help us better debug your problem.

 

One thing to keep in mind is that the "Find" and "FindChild" methods work in reverse order.  So, there may be an object in your application that meets the criteria that TestComplete finds before it finds the object you are looking to use.  


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
cancel
Showing results for 
Search instead for 
Did you mean: