changeset 12:737c903fc815

remove unnecessary files
author Robert McIntyre <rlm@mit.edu>
date Tue, 25 Oct 2011 08:01:43 -0700
parents 24ff8a9c76c4
children be73e58d4b24
files browser.pl main-firefox.pl play-browser.py refresh-browser.py sample.py
diffstat 5 files changed, 0 insertions(+), 94 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/browser.pl	Tue Oct 25 08:00:48 2011 -0700
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,18 +0,0 @@
     1.4 -#!/usr/bin/perl
     1.5 -
     1.6 -
     1.7 -use WWW::Selenium;
     1.8 -
     1.9 -my $sel = WWW::Selenium->new( host => "localhost",
    1.10 -			      port => 4444,
    1.11 -			      browser => "*firefox",
    1.12 -			      browser_url => "http://www.google.com",
    1.13 -			    );
    1.14 -
    1.15 -$sel->start;
    1.16 -$sel->open("http://www.google.com");
    1.17 -$sel->type("q", "hello world");
    1.18 -$sel->click("btnG");
    1.19 -$sel->wait_for_page_to_load(5000);
    1.20 -print $sel->get_title;
    1.21 -$sel->stop;
     2.1 --- a/main-firefox.pl	Tue Oct 25 08:00:48 2011 -0700
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,8 +0,0 @@
     2.4 -#!/usr/bin/perl
     2.5 -
     2.6 -use WWW::Mechanize::Firefox;
     2.7 -my $mech = WWW::Mechanize::Firefox->new();
     2.8 -$mech->get('http://google.com');
     2.9 -
    2.10 -$mech->eval_in_page('alert("Hello Firefox")');
    2.11 -my $png = $mech->content_as_png();
     3.1 --- a/play-browser.py	Tue Oct 25 08:00:48 2011 -0700
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,29 +0,0 @@
     3.4 -#!/usr/bin/env python
     3.5 -
     3.6 -
     3.7 -from selenium import webdriver
     3.8 -from selenium.common.exceptions import TimeoutException
     3.9 -from selenium.webdriver.support.ui import WebDriverWait # available since 2.4.0
    3.10 -import time
    3.11 -
    3.12 -# Create a new instance of the Firefox driver
    3.13 -#driver = webdriver.Firefox()
    3.14 -
    3.15 -driver = webdriver.Remote("http://localhost:7055/wd/hub", webdriver.DesiredCapabilities.FIREFOX)
    3.16 -
    3.17 -# go to the google home page
    3.18 -driver.get("http://tycho.usno.navy.mil/cgi-bin/timer.pl")
    3.19 -
    3.20 -time.sleep(2)
    3.21 -
    3.22 -driver.refresh()
    3.23 -
    3.24 -time.sleep(2)
    3.25 -
    3.26 -driver.refresh()
    3.27 -
    3.28 -time.sleep(2)
    3.29 -
    3.30 -
    3.31 -
    3.32 -driver.quit()
     4.1 --- a/refresh-browser.py	Tue Oct 25 08:00:48 2011 -0700
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,21 +0,0 @@
     4.4 -#!/usr/bin/env python
     4.5 -
     4.6 -
     4.7 -from selenium import webdriver
     4.8 -from selenium.common.exceptions import TimeoutException
     4.9 -from selenium.webdriver.support.ui import WebDriverWait # available since 2.4.0
    4.10 -import time
    4.11 -import sys
    4.12 -
    4.13 -
    4.14 -# Create a new instance of the Firefox driver
    4.15 -#driver = webdriver.Firefox()
    4.16 -
    4.17 -driver = webdriver.Remote("http://localhost:4444/wd/hub", webdriver.DesiredCapabilities.FIREFOX)
    4.18 -
    4.19 -
    4.20 -# go to the google home page
    4.21 -driver.get(sys.argv[1])
    4.22 -
    4.23 -# you HAVE to quit if you're reusing firefox sessions
    4.24 -driver.quit()
     5.1 --- a/sample.py	Tue Oct 25 08:00:48 2011 -0700
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,18 +0,0 @@
     5.4 -#!/usr/bin/env python
     5.5 -
     5.6 -from selenium import webdriver
     5.7 -from selenium.common.exceptions import NoSuchElementException
     5.8 -from selenium.webdriver.common.keys import Keys
     5.9 -import time
    5.10 -
    5.11 -browser = webdriver.Firefox() # Get local session of firefox
    5.12 -browser.get("http://www.yahoo.com") # Load page
    5.13 -assert "Yahoo!" in browser.title
    5.14 -elem = browser.find_element_by_name("p") # Find the query box
    5.15 -elem.send_keys("seleniumhq" + Keys.RETURN)
    5.16 -time.sleep(0.2) # Let the page load, will be added to the API
    5.17 -try:
    5.18 -    browser.find_element_by_xpath("//a[contains(@href,'http://seleniumhq.org')]")
    5.19 -except NoSuchElementException:
    5.20 -    assert 0, "can't find seleniumhq"
    5.21 -#browser.close()