Getting the demo to work

320 views
Skip to first unread message

Sharkus

unread,
Dec 23, 2011, 2:20:34 PM12/23/11
to Zucchini Framework
Hello all,
Sorry for the very newbie like question. I've used a few other iOS
automation tools (Frank, FoneMonkey, UIAutomation, and I created my
own script to provide for a CI environment for UIAutomation) but I'm
having trouble getting the demo to work by following the instructions.
I see the following in terminal (Mac OS X 10.6.8)

markw-imac:~ markwarren$ ZUCCHINI_DEVICE='QA iPhone 4 5' zucchini run /
Users/markwarren/Downloads/CoreDataBooks/features/
/Users/markwarren/.rvm/gems/ruby-1.8.7-p352/gems/zucchini-ios-0.5.3/
lib/config.rb:32:in `device': undefined method `[]' for nil:NilClass
(NoMethodError)
from /Users/markwarren/.rvm/gems/ruby-1.8.7-p352/gems/zucchini-
ios-0.5.3/lib/runner.rb:17:in `execute'
from /Users/markwarren/.rvm/gems/ruby-1.8.7-p352/gems/clamp-0.3.0/lib/
clamp/command.rb:73:in `execute'
from /Users/markwarren/.rvm/gems/ruby-1.8.7-p352/gems/clamp-0.3.0/lib/
clamp/command.rb:64:in `run'
from /Users/markwarren/.rvm/gems/ruby-1.8.7-p352/gems/clamp-0.3.0/lib/
clamp/command.rb:126:in `run'
from /Users/markwarren/.rvm/gems/ruby-1.8.7-p352/gems/zucchini-
ios-0.5.3/bin/zucchini:19
from /Users/markwarren/.rvm/gems/ruby-1.8.7-p352/bin/zucchini:19:in
`load'
from /Users/markwarren/.rvm/gems/ruby-1.8.7-p352/bin/zucchini:19

I've tried pointing it to the downloaded and expanded folder from the
demo, still no joy.

Any pointers as to what I am not doing?

vaskas

unread,
Dec 23, 2011, 2:38:19 PM12/23/11
to Zucchini Framework
Hi Mark,

Did you add your device to features/support/config.yml?

If yes, how does this file look now for you?

Markus

unread,
Dec 23, 2011, 2:44:07 PM12/23/11
to zucchini...@googlegroups.com
Hello,
So, which " features/support/config.yml?" should it be added to? the one inside the expanded "rajbeniwal-zucchini-demo-e7d24e5" folder, or the one inside the expanded "CoreDataBooks"

My assumption was to copy over the features folder from "rajbeniwal-zucchini-demo-e7d24e5" into CoreDataBooks, then build and install that on the device. After editing the config.yml file.

To answer your question the file looks like this:

app: CoreDataBooks.app
template: '/Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate'

devices:
  QA iPhone 4 5:
   UDID  : cd03808e3f0a20ca9a4e26692dda71d446c7e028
   screen: retina_ios4

Markus

unread,
Dec 23, 2011, 2:53:31 PM12/23/11
to zucchini...@googlegroups.com
I've had a bit of a play around with spaces and such in the config.yml file and now when executing the command it does launch the app on the device, so I think I may have had some kind of formatting error in there.
Is there a reason for the spaces before the device name, and for the space between the label UDID and the colon?

Also, when this does run, what exactly should it do, and what should I see in terminal?

On Fri, Dec 23, 2011 at 2:38 PM, vaskas <vasily.mik...@gmail.com> wrote:

Markus

unread,
Dec 23, 2011, 3:03:52 PM12/23/11
to zucchini...@googlegroups.com
Digging deeper, I'm looking in:
/Users/markwarren/Downloads/CoreDataBooks/features/add_book/run_data/Run\ 1/Automation\ Results.plist

and I find the following info:
Exception raised while running script: Screen 'Books' not defined\n

So it looks as though an error is being encountered when instruments / uiautomation is doing something.


On Fri, Dec 23, 2011 at 2:38 PM, vaskas <vasily.mik...@gmail.com> wrote:

vaskas

unread,
Dec 23, 2011, 3:24:47 PM12/23/11
to Zucchini Framework
Yes, there needs to be an indent for the whole device section, so that
it's treated as a part of the devices collection.
I was able to reproduce your error by de-indenting the block.
The space between UDID and the colon doesn't matter.

On Dec 24, 6:53 am, Markus <markuswar...@gmail.com> wrote:
> I've had a bit of a play around with spaces and such in the config.yml file
> and now when executing the command it does launch the app on the device, so
> I think I may have had some kind of formatting error in there.
> Is there a reason for the spaces before the device name, and for the space
> between the label UDID and the colon?
>
> Also, when this does run, what exactly should it do, and what should I see
> in terminal?
>

vaskas

unread,
Dec 23, 2011, 3:39:27 PM12/23/11
to Zucchini Framework
What output are you currently getting in the terminal?
Ideally, you're supposed to see a test summary in it :) Also, a
browser window with an HTML report should pop up.

It looks like the scripts don't get compiled properly. Which `coffee --
version` are you using?
If it still doesn't work for you, would you please post your features/
add_book/run_data/feature.js file here?

Also, as we get it to work, please note that only retina_ios5
reference screenshots are bundled with the demo.
You may try renaming the directory into retina_ios4 (which will give
you some interesting diffs in the end) or just copy your new actual
screenshots from run_data/Run\ 1/ to reference/retina_ios5.

On Dec 24, 7:03 am, Markus <markuswar...@gmail.com> wrote:
> Digging deeper, I'm looking in:
> /Users/markwarren/Downloads/CoreDataBooks/features/add_book/run_data/Run\
> 1/Automation\ Results.plist
>
> and I find the following info:
> Exception raised while running script: Screen 'Books' not defined\n
>
> So it looks as though an error is being encountered when instruments /
> uiautomation is doing something.
>

Sandhya Srinivasan

unread,
Feb 28, 2013, 7:14:44 PM2/28/13
to zucchini...@googlegroups.com
I am having issues in running the demo
I spent lot of time on this but could not get through


Pasting the error:

$ ZUCCHINI_DEVICE='xxx' zucchini run ~/Downloads/zucchini-demo-master/features/.

~/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/zucchini-ios-0.5.9/lib/config.rb:14:in `base_path=': undefined method `each' for nil:NilClass (NoMethodError)

from ~/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/zucchini-ios-0.5.9/lib/detector.rb:10:in `execute'

from ~/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/clamp-0.5.0/lib/clamp/command.rb:66:in `run'

from /~.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/clamp-0.5.0/lib/clamp/subcommand/execution.rb:10:in `execute'

from ~/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/clamp-0.5.0/lib/clamp/command.rb:66:in `run'

from ~/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/clamp-0.5.0/lib/clamp/command.rb:124:in `run'

from ~/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/zucchini-ios-0.5.9/bin/zucchini:22:in `<top (required)>'

from ~/.rbenv/versions/2.0.0-p0/bin/zucchini:23:in `load'

from ~/.rbenv/versions/2.0.0-p0/bin/zucchini:23:in `<main>'


config.yml contents:

app: CoreDataBooks.app

template: '/Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate'

devices:

QA iPhone :

 UDID  : xxx

 screen: retina_ios5

Please let me know how to resolve this.


Thanks,

Sandhya

Dave Stewart

unread,
Mar 1, 2013, 12:30:59 PM3/1/13
to zucchini...@googlegroups.com
Sandy, if I recall correctly ( I have my devices hardcoded to machines ) you should call zucchini like so:

$ ZUCCHINI_DEVICE="QA iPhone" zucchini run put_path_here...

Sandy

unread,
Mar 4, 2013, 2:34:09 PM3/4/13
to zucchini...@googlegroups.com
Thanks Dave
But now i'm getting 

Instruments Trace Error : Failed to start trace.

ZUCCHINI_DEVICE='QA iPhone' zucchini run zucchini-demo-master/features/.Instruments Trace Error : Failed to start trace.

/Users/wysessrinivasan/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/zucchini-ios-0.5.9/lib/feature.rb:72:in `block in collect': Instruments run error (RuntimeError)

from /Users/wysessrinivasan/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/zucchini-ios-0.5.9/lib/feature.rb:89:in `block in with_setup'

from /Users/wysessrinivasan/Downloads/zucchini-demo-master/features/add_book/setup.rb:4:in `before'

from /Users/wysessrinivasan/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/zucchini-ios-0.5.9/lib/feature.rb:89:in `with_setup'

from /Users/wysessrinivasan/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/zucchini-ios-0.5.9/lib/feature.rb:62:in `collect'

from /Users/wysessrinivasan/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/zucchini-ios-0.5.9/lib/runner.rb:19:in `block in run_command'

from /Users/wysessrinivasan/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/zucchini-ios-0.5.9/lib/runner.rb:13:in `each'

from /Users/wysessrinivasan/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/zucchini-ios-0.5.9/lib/runner.rb:13:in `run_command'

from /Users/wysessrinivasan/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/zucchini-ios-0.5.9/lib/detector.rb:16:in `execute'

from /Users/wysessrinivasan/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/clamp-0.5.0/lib/clamp/command.rb:66:in `run'

from /Users/wysessrinivasan/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/clamp-0.5.0/lib/clamp/subcommand/execution.rb:10:in `execute'

from /Users/wysessrinivasan/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/clamp-0.5.0/lib/clamp/command.rb:66:in `run'

from /Users/wysessrinivasan/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/clamp-0.5.0/lib/clamp/command.rb:124:in `run'

from /Users/wysessrinivasan/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/zucchini-ios-0.5.9/bin/zucchini:22:in `<top (required)>'

from /Users/wysessrinivasan/.rbenv/versions/2.0.0-p0/bin/zucchini:23:in `load'

from /Users/wysessrinivasan/.rbenv/versions/2.0.0-p0/bin/zucchini:23:in `<main>'


I have two Xcodes installed.But xcode-select -print-path shows the correct Xcode(4.6) path.Don't know what is causing this issue!

Any pointers will be helpful!

Thanks,

Sandhya

Dave Stewart

unread,
Mar 5, 2013, 4:07:34 PM3/5/13
to zucchini...@googlegroups.com
Sandy, that looks like the iOS 5.x / Xcode/Instruments 4.6 incompatibility problems that have cropped up recently.  What versions of iOS / Xcode are you using?

Sandy

unread,
Mar 5, 2013, 4:18:18 PM3/5/13
to zucchini...@googlegroups.com
Thanks Dave.
You are right i am able to run on iOS 6 device!!
I got element not found error which i resolved by adding delay in coffee script..
Finally I saw it running!!!

Thanks,
Sandhya

Dave Stewart

unread,
Mar 6, 2013, 2:22:47 PM3/6/13
to zucchini...@googlegroups.com
Good to hear, Sandy. :)

Katherine Yekhilevsky

unread,
May 14, 2014, 7:56:43 PM5/14/14
to zucchini...@googlegroups.com
Hi there I'm facing the same problem here.
I successfully installed CoreDataBooks app on my iPad 3 iOS7.1 from Xcode 5.1.1
Followed the instructions and install Zucchini 0.7.3.
Running the command ZUCCHINI_DEVICE="device name" zucchini run ././zucchini-demo-master/features
Getting the following error on the terminal:
/Library/Ruby/Gems/2.0.0/gems/zucchini-ios-0.7.3/lib/zucchini/config.rb:15:in `block in base_path=': undefined method `[]' for nil:NilClass (NoMethodError)
    from /Library/Ruby/Gems/2.0.0/gems/zucchini-ios-0.7.3/lib/zucchini/config.rb:14:in `each'
    from /Library/Ruby/Gems/2.0.0/gems/zucchini-ios-0.7.3/lib/zucchini/config.rb:14:in `base_path='
    from /Library/Ruby/Gems/2.0.0/gems/zucchini-ios-0.7.3/lib/zucchini/detector.rb:10:in `execute'
    from /Library/Ruby/Gems/2.0.0/gems/clamp-0.6.3/lib/clamp/command.rb:67:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/clamp-0.6.3/lib/clamp/subcommand/execution.rb:11:in `execute'
    from /Library/Ruby/Gems/2.0.0/gems/clamp-0.6.3/lib/clamp/command.rb:67:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/clamp-0.6.3/lib/clamp/command.rb:125:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/zucchini-ios-0.7.3/bin/zucchini:15:in `<top (required)>'
    from /usr/bin/zucchini:23:in `load'
    from /usr/bin/zucchini:23:in `<main>'

Please help!!!

Katherine Yekhilevsky

unread,
May 15, 2014, 4:33:36 PM5/15/14
to zucchini...@googlegroups.com
I got my zucchini working!!! :):):)
I just reinstalled everything step by step from the instructions.
Reply all
Reply to author
Forward
0 new messages