Hi Warren,

(cc-ing the list for Google's sake ;-)

Op 20-aug-2005, om 23:22 heeft Warren Pollans het volgende geschreven:

I'd like to be able to test some remote websites using selenium on my G3 ibook (10.3.9). I've used WWW::Mechanize (perl) from my ibook and watir (ruby) from a win2k box at work. I'd like to eliminate the windows box from my testing requirements.

Would you mind telling me what you had to install to get selenium working - I had read the article you mentioned in your post but couldn't tell which things, if any, were only required for windows and what I'd need on my ibook.

I will just write down everything I did. Some notes:
- Version numbers might change, of course. At this moment Selenium doesn't work with Twisted 2. - If you use packaging system, like Darwin Ports or Fink, you will probably want to use them to install the software. If you prefer pre- compiled packages, http://pythonmac.org/packages/ has lot's of Python stuff. If you prefer installing from source, Python packages can be installed with:
$ cd <installation directory of the package>
$ sudo python setup.py install

So the steps are:

1. No need to install Python, it's pre-installed on Panther and Tiger (Python 2.3). 2. Install Twisted 1.3.0 (from "old download page") and Twisted Web 0.5.0 (from the "projects" page) http://twistedmatrix.com/ (I installed Twisted 2.0 by mistake first, and had to install Zope interface package from http://pythonmac.org/packages/ too, but i don't think it's required by Twisted 1.3.0) 3. Install Subversion. Pre-compiled OSX version: http://metissian.com/ projects/macosx/subversion/
4. Assuming you put selenium into you home dir:
$ cd
$ svn co svn://beaver.codehaus.org/selenium/scm/trunk selenium
$ cd selenium/code/python/twisted/src/selenium/
$ cp -r ~/selenium/code/javascript/* selenium_driver/


Fix Windows-only code in selenium_server.py:

--- selenium_server.py  (revision 611)
+++ selenium_server.py  (working copy)
@@ -18,8 +18,8 @@
"""
# following two lines only needed on windows
-from twisted.internet import  win32eventreactor
-win32eventreactor.install()
+#from twisted.internet import  win32eventreactor
+#win32eventreactor.install()
from twisted.internet import reactor
@@ -35,7 +35,7 @@
     root = resource.Resource()

     # The proxy server (aka "The Funnel")
-    path = os.path.join(os.getcwd(),"cgi-bin","nph-proxy.exe")
+    path = os.path.join(os.getcwd(),"cgi-bin","nph-proxy.cgi")
     proxy = twcgi.CGIScript(path)
     root.putChild("AUT",proxy)



Fix Windows-only path in cgi-bin/nph-proxy.cgi:

--- cgi-bin/nph-proxy.cgi       (revision 611)
+++ cgi-bin/nph-proxy.cgi       (working copy)
@@ -1,4 +1,4 @@
-#!c:/Perl/bin/perl.exe
+#!/usr/bin/perl
#
#   CGIProxy 2.0.1
#



Make cgi-bin/nph-proxy.cgi executable:
$ chmod 755 cgi-bin/nph-proxy.cgi


Start the server:
$ python selenium_server.py


5. From here, follow the tutorial. When you run the examples (probably google-test-xmlrpc.pl or google-test-xmlrpc.rb in your case), change the system command to open url (os.system('start run_firefox.bat') in the original example)
from

os.system('\"C:\\Program Files\\Mozilla Firefox\\firefox.exe\" http:// localhost:8080/selenium-driver/SeleneseRunner.html')

to

os.system('open -b com.apple.Firefox http://localhost:8080/selenium- driver/SeleneseRunner.html')

(I experienced problems with some javascript calls in Safari, but everything works fine in Firefox. Your situation may vary :-)


Hope it works!

--Ksenia

_______________________________________________
Selenium-users mailing list
Selenium-users@lists.public.thoughtworks.org
http://lists.public.thoughtworks.org/mailman/listinfo/selenium-users

Reply via email to