WebDriver, Webdriver, and more web driver.

So recently I had compiled the Selenium 2 iPhone WebDriver on Xcode with iOS 5 sdk.

Boy.  That was a headache.

The steps were suppose to be easy, looking at : http://code.google.com/p/selenium/wiki/IPhoneDriver

Download XCode, Download the iOS 5 SDK, download the source,  run sudo ./go iphone and boom, I should have a working iphone app.  Well, there was a patch that landed sunday for the build.desc that fixed an issue with compilation.  Not only that, I then tried to get the xcode to compile, I got the following error message:

Unsupported compilerGCC 4.2selected for architecture ‘i386

I found the answer to my issues : ( http://debugfix.com/2011/11/unsupported-compiler-gcc-4-2-selected-for-architecture-i386/ )

“xcode build errors:

Unsupported compiler ‘GCC 4.2′ selected for architecture ‘i386′


This can be caused by importing a project for a pre- iOS 5 SDK into a copy of xcode with iOS 5 SDK only.

To fix, click your Project -> Build Settings.  Then under Build Options, there is an entry for Compiler for C/C++/Objective-C.  Choose Apple LLVM compiler 3.0.

There is a chance this could effect other aspects of your binaries as you are using a new compiler, so  YMMV.  That being said, it’s so far caused no issues for me.”

So, I thought I did that for the iphone xcode project, but I still kept getting that error.  Why? Little did I see the subproject inside the iphone web driver project… it’s called CocoaHTTPServerLibrary, and that also needs to have the adjustment.

Not only that the build directories when SVN’ed down were owned by root and Xcode didn’t have permission to build into them.  So after chmod’ing the build directory recursively down with a nice little sudo chmod -R, I finally got the iPhone Webdriver to compile using the xcode ui interface.  Yay.  It took a bit of figuring out and playing around with it and searching for the net for some answers.

What else did I get done?  Well, not just for the iphone, but I also got Virtual Box up and running with Ubuntu and various other platforms running the webdriver stuff:

  • Test on Unix platform (done)
  • 4. login ubuntu/reverse
  • 5. open terminal (search apps, may want to pin)
  • 6. java runtime needed : sudo apt-get install openjdk-7-jre-headless
  • 7. python 2.6: 2.7 already installed on vb
  • 8. sudo apt-get install python-setuptools ( to get easy_install)
  • 9. sudo easy_install pip
  • 10. sudo apt-get install git
  • 11. make a selenium directory:
  • 14. sudo pip install -r requirements.txt
  • optional install :
  • 15. run server on desktop: java -jar selenium-server-standalone-2.5.0.jar -firefoxProfileTemplate path:\firefoxprofiles\certificateExceptions
  • 16.
  • (note for linux: works; kinda)
  • py.test –browsername=”firefox” –browserver=8.0.1 –credentials=./credentials.yaml –platform=linux
  • (note for mac: works; kinda)
  • py.test –browsername=”firefox” –browserver=8.0.1 –credentials=./credentials.yaml –platform=mac
  • (note for chrome: works)
  •  Run tests against a local webdriver using Google Chrome:
  • py.test –driver=chrome –chromepath=/Applications/chromedriver
  • (note for iphone; works kinda)
  • py.test –credentials=./credentials.yaml –platform=REMOTE –host=”″ –port=3001 –browsername=iphone –browserver=8

So ya.  This shows you that webdriver, with the py.test can be pretty flexible in which platform you want to run the tests with.   The soft blocker that I have right now, is that unfortunately the mobile devices will show different web pages than the desktop, so I believe we may need to split the tests up.  In the meantime, I’m busy with other things that I have to test, create, do, etc. so I’m gonna ask for AMO web QA team for some help in regards to portion… And oh… selenium 2 looks hot.

I can’t wait til the Robotium stuff lands for Mobile Fennec!


Note: copy and pasting from wordpress may cause issues with the command line there should be two -‘s in the command line not one.


About shizen008

Breaking things and getting in trouble for it since '74. Disclaimer: I am not responsible if I make your head explode reading this blog! The writings here are my own expression and not of any companies. I currently work on being a QA for B2G aka Firefox OS
This entry was posted in Uncategorized. Bookmark the permalink.

6 Responses to WebDriver, Webdriver, and more web driver.

  1. Alex Kell says:

    Thank you for this post. I was just about to set up the iPhone driver myself. Good stuff!

  2. Pingback: A Smattering of Selenium #78 « Official Selenium Blog

  3. I get 5 errors when i try to compile iWebDriver on Xcode 4.2 – i need a beer.

  4. hey guys want more awesome xcode tutorials…

    we cover almost all the things necessary to start building your own application…

    our course is well organized and all the knowledge you require to start is a little bit of objective-c

    is still under construction….

    find our courses at http://www.codesavvy.webs.com

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s