擅长:python、mysql、java
<p>您需要在startApplication行之后设置一个断点。在它下面打个盹儿。在</p>
<p>一旦程序中断,几秒钟后,应用程序对象窗口将填充对象映射/层次结构。从这个层次结构中,可以线性方式访问对象。每次你展开一个对象来看到它的子对象,那就更深了一层。在</p>
<p>例如,假设我在“应用程序对象”窗口中看到的是一个可单击的右箭头,标记为:
->;主声明视图</p>
<p>然后我点击它,它就展开了:</p>
<h2>|主声明视图</h2>
<h2>->;某个按钮</h2>
<p>我访问SomeButton及其属性如下:</p>
<p>myButton=findObject(“:MainDeclarativeView.SomeButton“)</p>
<p>注意MainDeclarativeView前面的冒号和指定SomeButton是MainDeclarativeView的子对象的句点。现在,如果你这样做了:</p>
<p>鼠标单击(我的按钮)</p>
<p>你可以点击它。您也可以将waitForObject作为findObject的参数,然后将“:Main…”放在waitForObject中,但根据我的经验,这并没有什么不同。如果在“应用程序对象”菜单中看不到对象,则无法找到该对象并将其作为对象分配给变量。在</p>
<p>从现在起,您可以通过myButton访问SomeButton的属性,例如</p>
<p>showMeX=myButton.x</p>
<p>希望有帮助</p>