Display results as :

Rechercher Advanced Search

Latest topics
» Run automated selenium test scripts from JIRA ondemand
Fri Dec 08, 2017 12:40 pm by azharuddin

» New! Appium Desktop
Sat Nov 25, 2017 3:51 pm by azharuddin

» Selenium WebDriver Integration
Tue Nov 21, 2017 1:06 pm by azharuddin

» how to connect DB in selenium webriver
Fri Oct 06, 2017 4:09 pm by anbarasi

» How find any text in browser screen and click on it?
Thu Oct 05, 2017 2:02 pm by sandeepkommineni

» Selenium Webdriver
Tue Oct 03, 2017 1:35 pm by PiyushBiswas

» GRID setup tutorial.
Wed Sep 27, 2017 4:29 pm by johnyapp

» Drag & Drop Between Windows Using Selenium Driver
Wed Sep 27, 2017 2:10 pm by 26rondel

» Check if window is closed / verify input
Sat Sep 23, 2017 10:21 pm by brainstir


Opne page n times

View previous topic View next topic Go down

Opne page n times

Post by arve_lek on Mon Jun 14, 2010 3:43 am

This is my first post so hello.

I trying to write program in ruby but i'm newbie. Sorry for my english becasue is week. Between code the are comments.


require "test/unit"
require "rubygems"
gem "selenium-client"
require "selenium/client"

class Untitled < Test::Unit::TestCase

  def setup
    @verification_errors = []
    @selenium = \
      :host => "localhost",
      :port => 4444,
      :browser => "*chrome",
      :url => "", [b][color=red]#this is only example.[/color][/b]
      :timeout_in_second => 60

  def teardown
    assert_equal [], @verification_errors
  def test_untitled "/"
    @selenium.type "username", "type yours username"
    @selenium.type "password", "type ypurs password" "login"
    #@selenium.wait_for_page_to_load "30000"
    for i in (1..10000)
            puts i
   "here adress page" [b]#here i want open page
times. Maybe i will baned (IP) after when i open 30times page, maybe 
when i open 700... [/b]
            assert @selenium.is_text_present("everything is okey")[b]#now i'm baned and program knows that becasue doesn't see message "everything is okey" than is goind to rescue
[/b]            @selenium.wait_for_page_to_load "30000"
            rescue [b]#here program waiting until admin will unblock my IP.[/b]
                [color=black]assert_equal "Your IP is baned!", @selenium.get_text("//p") [b]# When my IP will be unlocked than this message will dissapear[/b]
                return[/color] #now i can open page: "here adress page"

Something isn't okey with my code becasue doesn't work correctly.

Any sugestion??


Posts : 1
Join date : 2010-06-14

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum