Forum Discussion
OK, I'm not at all experienced in Python so some of what I'm seeing may just be me. However, look at the following line of code:
if Tgence.getzremindBtn().Exists
I'm not sure what "getzremindBtn()" is... it appears to be a call to an object. If this is the case, and there's not some other processing going on, you are checking for the "exists" property on an object that, potentially, does not exist yet. This could cause some odd errors and problems. Check out the following topic and see if you can add one of those WaitNNN methods to your code in order to better handle this code.
https://support.smartbear.com/viewarticle/82625/?q=WaitNNN#WaitMethods
- rangaperera8 years agoOccasional Contributor
Thank you very much for responding.
In this case, it does find the object, every time. Then it seems like mouse click even gets executed to a certain degree. What I mean by that is, since the curser move into the correct position for the mouse click, I assume mouse click gets executed. However, "OK" button never gets pressed.
- tristaanogre8 years agoEsteemed Contributor
Another possibility could be that there is a "flicker" in the object. It is found, it exists, and the click method appears to work, but the object may change state somewhere in the process where the click may execute but it may not actually be valid at that point. This is something I've rarely seen in my experience but it is, technically, possible.
Just as a diagnostic bit, have you tried putting a Delay call in the code before your call to click? Add maybe a second or two delay before the click to give the application a chance to "stabilize" before the click is excuted. What this might indicate, if it works, is that you need to do some additional checks other than "exists" to make sure that you can actually click the button. You might need to use a WaitProperty call on the button to make sure it's enabled.Just a few things to try.
Related Content
Recent Discussions
- 2 days ago