如何使用Java Access Bridge自动化Java Applet?

时间:2017-05-17 13:10:59

标签: java automation applet java-access-bridge

我需要自动化一个位于IE浏览器网站内的Java Applet。我知道我可以使用Java Access Bridge与Java应用程序进行交互,但是我无法找到如何将其连接到Applet。

我知道一个名为GetAccessibleContextFromHWND(..)的Java Bridge方法,我认为我可以使用它。不幸的是,当我使用Spy ++尝试获取Applet的HWND时,我又回来了,所以看起来这是使用通常的FindWindow(..) Windows API函数无法完成的。

如何使用Java Access Bridge访问和控制Java Applet?

1 个答案:

答案 0 :(得分:0)

1.Find Applet tag from HTML page and get position(Height/Width) of it.

2.Move your cursor toward Applet center position with reference of IE window.

3.Use **getAccessibleContextAt** API and use Applet x,y position.

4.Get Accesiblecontext from above API.

5.Iterate to root level Accesiblecontext. Finally you will get first object of Applet window.