Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
arve_lek
Posts : 1
Join date : 2010-06-14
http://www.kafelek.com.pl/

Opne page n times Empty Opne page n times

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.

Code:

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

class Untitled < Test::Unit::TestCase

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

    @selenium.start_new_browser_session
  end
 
  def teardown
    #@selenium.close_current_browser_session
    assert_equal [], @verification_errors
  end
 
  def test_untitled
    @selenium.open "/"
   
    @selenium.type "username", "type yours username"
    @selenium.type "password", "type ypurs password"
    @selenium.click "login"
    #@selenium.wait_for_page_to_load "30000"
    for i in (1..10000)
            puts i
            @selenium.open "here adress page" [b]#here i want open page
 1...10000
times. Maybe i will baned (IP) after when i open 30times page, maybe 
when i open 700... [/b]
        begin
            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: @selenium.open "here adress page"
        end
    end
  end
end


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

Any sugestion??
Back to top
Permissions in this forum:
You cannot reply to topics in this forum