Permission Denied - when attempting to use Exists.
I'm running in to an intermittent problem (10% of the time) where myControl.Exists is giving me a Microsoft JScript runtime error. I run in to in several places in my code, but one such example is where I'm attempting to wait for a control to become available, and when it does I click on it. Here is the code that is generating the problem.
do { myControl = page.FindChildByXPath(xpath_element); }
while (!myControl.Exists && elapsedTime <= maxWait);
So far I've checked to ensure it's not related to my browser (since it happens in any browser), or my security level since I'm an admin on my machine and all the files I'm working with are local.
I have a hypothesis on the cause, but it's just a stab in the dark. These seem to correlate to when the page is going out to the database to obtain updated records, then it updates the page. Could it be related to the fact that the DOM is changing while this method is running? PS I find the same problem when posting messages to the Log- also happens intermittently.
I'd appreciate any thoughts on how to deal with this.
Thanks!
Brent
Hello Brentp,
Wait and WaitPage methods will NOT get the job done. I've found this very good article from SmartBear. Check it out http://support.smartbear.com/viewarticle/57082/#Check
Let me know if that helps.
Regards,
Leandro de Araújo Souza