Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Daniel Santos

macrumors newbie
Original poster
Nov 1, 2012
26
10
Portugal
Hi all,

I have an application in cocoa/swift that I developed. Now I want to automate tests using applescript.
I don't know how to click a button inside a tabbed view.

To access the tabbed view I do :

click the radio button "Browse" of the first tab group of window "Window"

then I do :

click button "Apply" of the first tab group of window "Window"

which is a button in the pane corresponding to the tab I selected previously.
I am using script debugger and it reports a "missing value" and the the application exits.
 

superscape

macrumors 6502a
Feb 12, 2008
937
223
East Riding of Yorkshire, UK
Hi there,

I don't have a direct answer to your question, unfortunately. However, whenever I see UI scripting I usually start trying to find any conceivable alternative - it's almost always ends in exasperation for me. That said, I admit that it does have some value use cases.

In this case, there's an alternative built straight into Xcode for just this purpose. Look into UI testing. Perhaps this link would be a good place to start:

https://robkerr.com/understanding-ui-testing-using-ios-xcode-9-and-swift-c66a49eb8469

Hope that's of some help.
 

Daniel Santos

macrumors newbie
Original poster
Nov 1, 2012
26
10
Portugal
Hi,

I wasn't aware of the UI testing feature of Xcode. I'll give it a go. Anyway I solved my problem with applescript.
It all comes down to delays. When you act on the UI of the application before the application is ready again to
accept further commands one has to wait a bit. That was my problem.

I was sending two commands in quick succession to the app, which made it crash, and the next applescript instruction could find the process anymore.

Thanks for your help

Hi there,

I don't have a direct answer to your question, unfortunately. However, whenever I see UI scripting I usually start trying to find any conceivable alternative - it's almost always ends in exasperation for me. That said, I admit that it does have some value use cases.

In this case, there's an alternative built straight into Xcode for just this purpose. Look into UI testing. Perhaps this link would be a good place to start:

https://robkerr.com/understanding-ui-testing-using-ios-xcode-9-and-swift-c66a49eb8469

Hope that's of some help.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.