error on test_on_physical_device_via_bonjour

224 views
Skip to first unread message

BrFrank

unread,
Jun 7, 2012, 12:05:44 PM6/7/12
to frank-...@googlegroups.com

I have got the latest code using the following:

Added the following to my env.rb among other changes (https://github.com/moredip/Frank/commit/8ec2d2c92e05880c31428d01491d4685199b54ba):

require 'frank-cucumber'
Frank::Cucumber::FrankHelper.use_shelley_from_now_on
$USING_PHYSICAL_DEVICE = !!ENV['USE_PHYSICAL_DEVICE']
if $USING_PHYSICAL_DEVICE
  Frank::Cucumber::FrankHelper.test_on_physical_device_via_bonjour (ERROR LINE)
  After do
    step 'I ask the app to reset to home'
  end
end


And when I run the test I get this error:

undefined method `test_on_physical_device_via_bonjour' for Frank::Cucumber::FrankHelper:Module (NoMethodError)
/xxx//features/support/env.rb:20
/Library/Ruby/Gems/1.8/gems/cucumber-1.1.9/bin/../lib/cucumber/rb_support/rb_language.rb:129:in `load'
/Library/Ruby/Gems/1.8/gems/cucumber-1.1.9/bin/../lib/cucumber/rb_support/rb_language.rb:129:in `load_code_file'
/Library/Ruby/Gems/1.8/gems/cucumber-1.1.9/bin/../lib/cucumber/runtime/support_code.rb:171:in `load_file'
/Library/Ruby/Gems/1.8/gems/cucumber-1.1.9/bin/../lib/cucumber/runtime/support_code.rb:83:in `load_files!'
/Library/Ruby/Gems/1.8/gems/cucumber-1.1.9/bin/../lib/cucumber/runtime/support_code.rb:82:in `each'
/Library/Ruby/Gems/1.8/gems/cucumber-1.1.9/bin/../lib/cucumber/runtime/support_code.rb:82:in `load_files!'
/Library/Ruby/Gems/1.8/gems/cucumber-1.1.9/bin/../lib/cucumber/runtime.rb:175:in `load_step_definitions'
/Library/Ruby/Gems/1.8/gems/cucumber-1.1.9/bin/../lib/cucumber/runtime.rb:40:in `run!'
/Library/Ruby/Gems/1.8/gems/cucumber-1.1.9/bin/../lib/cucumber/cli/main.rb:43:in `execute!'
/Library/Ruby/Gems/1.8/gems/cucumber-1.1.9/bin/../lib/cucumber/cli/main.rb:20:in `execute'
/Library/Ruby/Gems/1.8/gems/cucumber-1.1.9/bin/cucumber:14
/usr/bin/cucumber:19:in `load'
/usr/bin/cucumber:19

Any help is really appreciated.
Thank you

Peter Hodgson

unread,
Jun 7, 2012, 2:23:48 PM6/7/12
to frank-...@googlegroups.com
I'm guessing you're not using the latest frank-cucumber gem, even though you have the latest source code. Ruby will load from the available gems in your system unless you explicitly mess with the load path to tell it to do otherwise.

Easiest way to fix this would be to do a `gem update frank-cucumber`, and then try again.

Cheers,
Pete

Taylor, Martin

unread,
Jun 7, 2012, 2:59:29 PM6/7/12
to frank-...@googlegroups.com

I’m not using Cucumber or Ruby at all…

But by some magic a re-build of my Frankified app target got it basically working with Symbiote.  Now I’m trying to get my RobotFramework libraries working again.

 

I’d still like to know how to deal with submodules in a GIT fork!

 

Thanks,

Martin

BrFrank

unread,
Jun 7, 2012, 10:58:54 PM6/7/12
to frank-...@googlegroups.com
Thanks Pete, you are a genius!!
I just had to update the frank-cucumber gem (from 0.8.8 to 0.8.16) as you mentioned and then updated the rspec gem.

Now I am getting this error when running the script:

bad URI(is not URI?): http://192.xxx.1.74:37265 (URI::InvalidURIError)

Thanks
Marcio

Peter Hodgson

unread,
Jun 8, 2012, 1:21:18 AM6/8/12
to frank-...@googlegroups.com
Woo hoo, I just keep releasing gems with bugs! I have a fix for this issue. It was actually a regression introduced while fixing the regression I introduced by doing this physical device stuff in the first place.

Anyway, 0.8.17 which I just released should get all this resolved. Third time's a charm...

BrFrank

unread,
Jun 9, 2012, 2:55:24 AM6/9/12
to frank-...@googlegroups.com

Wooo Hooo I just wish I could show you my big smile when I saw the app running on the iPad device!!

Thanks a lot Pete for all the support!!!! ;)
Marcio

BrFrank

unread,
Jun 20, 2012, 11:43:08 PM6/20/12
to frank-...@googlegroups.com

Hey Pete

I just have a follow up question on this.
Now is everything working fine on the devices; however I would like to use the sim_launcher and export USE_PHYSICAL_DEVICE=false to kick off the script on the simulator sometimes automatically.

I noticed I had to change the env.rb file by removing 1 exclamation mark to get it to be false
$USING_PHYSICAL_DEVICE = !ENV["USE_PHYSICAL_DEVICE"]

The only problem now is that the simulator opens and I can see the app on it, but the app does not starts and shows FAILED TO PING!!!

I would love to set up the environment in a way that I could use both device and simulator (automatically launch using sim_laucher). Needless to say that it works fine on simulator when I start it and use bonjour.

So any input would be really appreciated.

Thanks

Peter Hodgson

unread,
Jun 20, 2012, 11:54:25 PM6/20/12
to frank-...@googlegroups.com
Hi Marcio,

The way I wrote the USE_PHYSICAL_DEVICE stuff was pretty simplistic. If that environment variable is set to *any* value that is interpreted as a request to use the physical device rather than the simulator. This means that setting that variable to 'false' actually turns it on, which I realize is quite counter-intuitive.

If you want to run on the simulator you can just not set that environment variable at all and you should be good. Alternatively you can modify the code which checks the environment variable to be a bit smarter. For example you could do something like:

$USING_PHYSICAL_DEVICE = !!(ENV['USE_PHYSICAL_DEVICE'].match(/(true|t|yes|y|1)$/i))

Hope that helps,
Pete

BrFrank

unread,
Jun 21, 2012, 2:10:13 AM6/21/12
to frank-...@googlegroups.com
 Thanks a lot for the quick reply, but for some reason it is still not working when I have the sim_launcher ON and remove the USE_PHYSICAL_DEVICE flag

The simulator opens and I can see the app on it, but the app does not starts and shows FAILED TO PING!!!

I am using the following on my launch_steps.rb:

Given /^I launch the app using iOS (\d\.\d) and the (iphone|ipad) simulator$/ do |sdk, version|
  launch_app app_path, sdk, version
end

instead

Given /^I manually launch the app$/ do
  unless $USING_PHYSICAL_DEVICE
    launch_app app_path unless ENV.key?('DONT_RELAUNCH')
  end
end

I will have to do more investigation on how to set up the tests on the device and auto tests on simulator via sim_launcher.
Thanks again for all your support.

Sagar Patil

unread,
Jul 24, 2012, 7:07:11 PM7/24/12
to frank-...@googlegroups.com
Hi,

I am trying to get this running..

basic question: Do I need to be a 99$/yr paid apple developer registered user to have it running on the device ?

if not then i tried steps

Added the following to my env.rb among other changes (https://github.com/moredip/Frank/commit/8ec2d2c92e05880c31428d01491d4685199b54ba):

require 'frank-cucumber'
Frank::Cucumber::FrankHelper.use_shelley_from_now_on
$USING_PHYSICAL_DEVICE = !!ENV['USE_PHYSICAL_DEVICE']
if $USING_PHYSICAL_DEVICE
  Frank::Cucumber::FrankHelper.test_on_physical_device_via_bonjour (ERROR LINE)
  After do
    step 'I ask the app to reset to home'
  end
end

I also changed the launchsteps.rb

  unless $USING_PHYSICAL_DEVICE
    app_path = ENV['APP_BUNDLE_PATH'] || (defined?(APP_BUNDLE_PATH) && APP_BUNDLE_PATH)
    launch_app app_path unless ENV.key?('DONT_RELAUNCH')
  end



Given I launch the app # step_definitions/launch_steps.rb:11
      
      
      ================================================================================
      APP_BUNDLE_PATH is not set. 
      
      Please set APP_BUNDLE_PATH (either an environment variable, or the ruby constant in support/env.rb) to the path of your Frankified target's iOS app bundle.
      ================================================================================
      
       (RuntimeError)
      ./step_definitions/launch_steps.rb:14:in `/^I launch the app$/'


my gem list is 

addressable (2.2.8)
base64_compatible (0.0.1)
builder (3.0.0)
childprocess (0.3.2)
cucumber (1.2.1)
diff-lcs (1.1.3)
dnssd (2.0)
ffi (1.0.11)
frank-cucumber (0.9.4)
gherkin (2.11.1)
i18n (0.6.0)
json (1.6.6)
libwebsocket (0.1.3)
linecache (0.46)
multi_json (1.3.5)
plist (3.1.0)
rack (1.4.1)
rack-protection (1.2.0)
rake (0.9.2.2)
rbx-require-relative (0.0.9)
rspec (2.11.0)
rspec-core (2.11.1, 2.9.0)
rspec-expectations (2.11.1)
rspec-mocks (2.11.1, 2.9.0)
ruby-debug-base (0.10.5.jb2)
ruby-debug-ide (0.4.17.beta8)
rubyzip (0.9.8)
selenium-webdriver (2.21.2)
sim_launcher (0.3.8)
sinatra (1.3.2)
slowhandcuke (0.0.3)
syntax (1.0.0)
term-ansicolor (1.0.7)
thor (0.15.4)
tilt (1.3.3)



I am pretty sure I am missing some silly thing.. would some one please point that out for me?

Thanks for such a great forum,
Sagar

BrFrank

unread,
Jul 24, 2012, 11:20:00 PM7/24/12
to frank-...@googlegroups.com
Do you have the APP_BUNDLE_PATH set as environment variable?

Sagar Patil

unread,
Jul 25, 2012, 1:49:08 PM7/25/12
to frank-...@googlegroups.com
Hi BrFrank,

No i dont have set it as environment variable..

I had commented the line in env.rb, if i uncomment that.. then cucumber launches simulator ..
#ENV['APP_BUNDLE_PATH'] = "/Users/xxxx/Library/Developer/Xcode/DerivedData/xxxxxx-xxxxxxxxx/Build/Products/Debug-iphonesimulator/Appxxx copy.app"#


Do I have to set it as env variable ? if yes can you please let me the right way..I searched the net and there were many approaches 

--
Sagar

frankUser

unread,
Dec 16, 2012, 10:37:21 AM12/16/12
to frank-...@googlegroups.com
Hi all, 


I am using the following

1. git clone git://github.com/moredip/Frank.git
2. cd Frank
3. git submodule update --init
4. rake
5. on mac: export USE_PHYSICAL_DEVICE=true
6. frank setup (in my project lib)
7. frank build (in my project lib)
8. editing the env.rb: (in my project lib)

require 'frank-cucumber'

APP_BUNDLE_PATH="Frank/frankified_build/Frankified.app"

Frank::Cucumber::FrankHelper.use_shelley_from_now_on

$USING_PHYSICAL_DEVICE = !!ENV['USE_PHYSICAL_DEVICE']

if $USING_PHYSICAL_DEVICE
  Frank::Cucumber::FrankHelper.test_on_physical_device_via_bonjour

  After do
    step 'I ask the app to reset to home'
  end
end

9. frank launch.

and I still can't launch the app on my iPhone (the app launch on the simulator) . I have distributor licence... 

Please advice...
Thanks! 

Tony ZH

unread,
May 7, 2013, 6:39:46 AM5/7/13
to frank-...@googlegroups.com
Hi,

I am having the same problem. Have you managed to resolve the issue?

Kyle Kendall

unread,
May 15, 2013, 11:59:12 AM5/15/13
to frank-...@googlegroups.com
I believe you need to do a little more than that.  This tutorial will help.  If you are a noob like me and don't understand it that well at first, I can help explain what it tells you to do.  I can't get my Frankified app to run.  I can run any other app using fruitstrap, but I am having problems running my Frankified.app.  

Kyle Kendall

unread,
May 15, 2013, 5:58:44 PM5/15/13
to frank-...@googlegroups.com
Hi Sagar,

Did you end up using Frank?  My company was leaning towards using Frank but we cannot get it loaded on a device and it looks like you had a similar problem.  Did you ever get this resolved?  Or did you move on to another way of iOS testing?
Reply all
Reply to author
Forward
0 new messages