Hi Savannah,
This should get you most of the way there. Think there's more info on
watirwebdriver.com if you want to use an emulator or really need to run
things on an actual device. The only drawback to the approach below is that
I don't think Safari is supported right now (but see website.)
*gem install webdriver-user-agent*
Then start a pry or irb session and do this:
*require 'watir-webdriver'*
*require 'webdriver-user-agent'*
*driver = Webdriver::UserAgent.driver(*
* browser: :firefox, # :firefox or :chrome if you have chromedriver
installed.*
* agent: :iphone, *
* orientation: :portrait*
*)*
*browser = Watir::Browser.new driver*
*browser.goto('politico.com') # Only because I know that's a
mobile-responsive site.*
Footnote: Got a little curious about why Safari wasn't supported and found
the user agent gem repository on Github and started poking around.
https://github.com/alisterscott/webdriver-user-agent
I think the Safari support isn't there because it's not easy to muck around
with the user agent string on that platform. But in the example above
Firefox is identifying itself as an iphone so it's pretty close.
John
On Saturday, November 21, 2015 at 8:24:25 AM UTC-8, Savannah wrote:
>
> Hi Everyone, i am a beginner of watir.
>
> I want to know Is it possible to run webdriver on IOS devices?
> We expect to make an iPhone app running webdriver to do web UI testing
> sort of jobs automatically after deploying the app to IOS devices.
> Therefore, we need:
>
> 1.Either install webdriver on IOS somehow
>
> 2. or have webdriver as a standalone toolbox that still can be called in
> our ruby code and can also be packaged in our final app to run on IOS
> devices.
> We haven't seen such a functionality, so we want to check with you.
>
> Thank you.^^
>
--
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
[email protected]
http://groups.google.com/group/watir-general
[email protected]
---
You received this message because you are subscribed to the Google Groups
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.