How to wait for a java applet to load when automating Internet Explorer?

447 Views Asked by At

I am using mshtml and internet explorer to automate a website. The website is not publicly available. On a page there is a Java Applet which is contained in a APPLET html tag.

The problem is that sometimes the applet takes a long time to load and without it being loaded other controls on the webpage cause errors. I do not need to automate the applet and the applet has nothing to do with what I want to do other than it causes other problems.

Whilst there might be other things you would like to suggest, I would at this stage like to focus on my main question of trying to find some property or event in the HTML which indicates that the Applet is loaded.

Things I have tried to check; The HTML document has an Applets property which returns the applet collection. This collection contains the applet. The Applet has a readystate of 4, its object attribute is also not nothing.

Despite these checks the applet is still not loaded.

1

There are 1 best solutions below

0
On BEST ANSWER

Anyone coming here, I am sorry but the answer to this question is that I could not find anything in the DOM (the html page) which indicated if the applet had loaded. I, however, believe that it will really depend on the page you are looking at. I think that due to security issues you cannot access the isActive function of the Applet itself. The best you can hope for is that there might be some other html or javascript on the page which also waits for the applet and then you can wait for this.