Monday, October 24, 2011

Инструкция по установке Selenium на Windows

  • Скачать с http://seleniumhq.org/download/ Selenium Server и запустить 'java -jar selenium-server-standalone-2.8.0.jar' и запустить, должно написать что-то вида:
    18.10.2011 12:00:46 org.openqa.grid.selenium.GridLauncher main
    INFO: Launching a standalone server
    12:00:46.970 INFO - Java: Sun Microsystems Inc. 20.1-b02
    12:00:46.980 INFO - OS: Windows XP 5.1 x86
    12:00:47.020 INFO - v2.8.0, with Core v2.8.0. Built from revision 14056
    12:00:47.440 INFO - RemoteWebDriver instances should connect to: http://127.0.0.
    1:4444/wd/hub
    12:00:47.440 INFO - Version Jetty/5.1.x
    12:00:47.450 INFO - Started HttpContext[/selenium-server/driver,/selenium-server
    /driver]
    12:00:47.450 INFO - Started HttpContext[/selenium-server,/selenium-server]
    12:00:47.450 INFO - Started HttpContext[/,/]
    12:00:47.571 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@110b05
    3
    12:00:47.581 INFO - Started HttpContext[/wd,/wd]
    12:00:47.631 INFO - Started SocketListener on 0.0.0.0:4444
    12:00:47.631 INFO - Started org.openqa.jetty.jetty.Server@1027b4d
    
  • Установить python http://www.python.org/download/ Python 2.7.2 Windows Installer
  • Установить PIP. Нужно запустить http://python-distribute.org/distribute_setup.py затем https://raw.github.com/pypa/pip/master/contrib/get-pip.py . И запустить  
    C:\Python27>python.exe get-pip.py
    Downloading/unpacking pip
      Downloading pip-1.0.2.tar.gz (105Kb): 105Kb downloaded
      Running setup.py egg_info for package pip
    
        warning: no files found matching '*.html' under directory 'docs'
        warning: no previously-included files matching '*.txt' found under directory
     'docs\_build'
        no previously-included directories found matching 'docs\_build\_sources'
    Installing collected packages: pip
      Running setup.py install for pip
    
        warning: no files found matching '*.html' under directory 'docs'
        warning: no previously-included files matching '*.txt' found under directory
     'docs\_build'
        no previously-included directories found matching 'docs\_build\_sources'
        Installing pip-script.py script to C:\Python27\Scripts
        Installing pip.exe script to C:\Python27\Scripts
        Installing pip-2.7-script.py script to C:\Python27\Scripts
        Installing pip-2.7.exe script to C:\Python27\Scripts
    Successfully installed pip
    Cleaning up...
    
  • Установить Selenium:
    C:\Python27>Scripts\pip.exe install -U selenium
    Downloading/unpacking selenium
      Downloading selenium-2.8.1.tar.gz (2.9Mb): 2.9Mb downloaded
      Running setup.py egg_info for package selenium
    
    Downloading/unpacking rdflib==3.1.0 (from selenium)
      Downloading rdflib-3.1.0.tar.gz (249Kb): 249Kb downloaded
      Running setup.py egg_info for package rdflib
    
    Installing collected packages: selenium, rdflib
      Running setup.py install for selenium
    
      Running setup.py install for rdflib
    
    Successfully installed selenium rdflib
    Cleaning up...
    
  • Проверить работоспособность скрипта http://pypi.python.org/pypi/selenium#example
  • Соединение между сервером тестирования (jar апплет) и скриптом тестирования(python) идет по обычному http так что запуск браузера можно проверить и без скриптов.

No comments: