Tag Archives: 테스트 자동화

인스트루먼트Instruments의 UI Automation을 알아보자!

 Automation JavaScript in Instruments

인스트루먼트 내장 에디터로 Automation JavaScript를 작성

 

다음은 <iPhone SDK 튜토리얼 2> p443에서 언급된 UIAElement의 모든 엘리먼트를 표시하는 Javascript 코드이다.

// List element hierarchy for the Recipes screen
UIALogger.logStart("Logging element tree …");
UIATarget.localTarget().logElementTree();
UIALogger.logPass();

 

작성된 Javascript로 Automation을 실행한 결과의 ElementTree

작성된 Javascript로 Automation을 실행한 결과의 ElementTree

 

화면의 특정 영역을 터치하도록 하고 싶으면 단순하게 아래와 같은 자동화 코드를 사용하면 된다.

 UIATarget.localTarget().tap({x:100, y:200});