I got it to work in ruby, but I have to start the selenium servver
manualy before I runn the program. That is unesesary mutch work and
complicated. Is there a way to start the selenium server inside the code
and stop it at the end?
Here is a code example i got to work... it is a bit messy
before :all do @browser = Selenium::Client::Driver.new \
:host => "localhost",
:port => 4444,
:browser => "*firefox",
:url => "http://www.google.com",
:timeout_in_second => 60
end
after :all do @browser.close_current_browser_session
end
it "test1" do @browser.start_new_browser_session @browser.open "/" @browser.type "q", "Selenium seleniumhq.org" @browser.click "btnG", :wait_for => :page
assert @browser.text?("seleniumhq.org")
end
end
What do I need to add to get it to start the selenium server automaticly
and stop it at the end?
You might want to take a look at Webrat if you haven't already [0] You can
fairly easily switch between a simulated browser (if you don't need to test
javascript) or run in automated mode i.e. selenium.
On Wed, Jul 1, 2009 at 12:43 PM, Kga Agk <lord_kga@yahoo.no> wrote:
I got it to work in ruby, but I have to start the selenium servver
manualy before I runn the program. That is unesesary mutch work and
complicated. Is there a way to start the selenium server inside the code
and stop it at the end?
Here is a code example i got to work... it is a bit messy
before :all do @browser = Selenium::Client::Driver.new \
:host => "localhost",
:port => 4444,
:browser => "*firefox",
:url => "http://www.google.com",
:timeout_in_second => 60
end
after :all do @browser.close_current_browser_session
end
it "test1" do @browser.start_new_browser_session @browser.open "/" @browser.type "q", "Selenium seleniumhq.org" @browser.click "btnG", :wait_for => :page
assert @browser.text?("seleniumhq.org")
end
end
What do I need to add to get it to start the selenium server automaticly
and stop it at the end?
--
Posted via http://www.ruby-forum.com/\.
You might want to take a look at Webrat if you haven't already [0] You
can
fairly easily switch between a simulated browser (if you don't need to
test
javascript) or run in automated mode i.e. selenium.
I can take a look, but I have to test some sites using javascript. I
have to test a bunch of server side programs, and the way to start them
is to click on stuff that are generated by javascript (or somthing like
that).
--
Posted via http://www.ruby-forum.com/\.
That's fine too. As I said earlier it can run selenium tests/server. The key
difference being this abstracts that away and manages the lifecycle of the
selenium server for you.
···
On Wed, Jul 1, 2009 at 2:19 PM, Kga Agk <lord_kga@yahoo.no> wrote:
Ben Lovell wrote:
> On Wed, Jul 1, 2009 at 12:43 PM, Kga Agk <lord_kga@yahoo.no> wrote:
>
>> require 'rubygems'
>> require "selenium/client"
>> :url => "http://www.google.com",
>> @browser.type "q", "Selenium seleniumhq.org"
>> --
>> Posted via http://www.ruby-forum.com/\.
>>
>>
> You might want to take a look at Webrat if you haven't already [0] You
> can
> fairly easily switch between a simulated browser (if you don't need to
> test
> javascript) or run in automated mode i.e. selenium.
>
> [0] gitrdoc.com
>
> Rgds,
> Ben
I can take a look, but I have to test some sites using javascript. I
have to test a bunch of server side programs, and the way to start them
is to click on stuff that are generated by javascript (or somthing like
that).
--
Posted via http://www.ruby-forum.com/\.
On Wed, Jul 1, 2009 at 2:19 PM, Kga Agk <lord_kga@yahoo.no> wrote:
>>
I can take a look, but I have to test some sites using javascript. I
have to test a bunch of server side programs, and the way to start them
is to click on stuff that are generated by javascript (or somthing like
that).
--
Posted via http://www.ruby-forum.com/\.
That's fine too. As I said earlier it can run selenium tests/server. The
key
difference being this abstracts that away and manages the lifecycle of
the
selenium server for you.
Do you have an easy example. Soem code that i can easely copy paste and
it works? I am new to this kind of coding and I have some problems.
--
Posted via http://www.ruby-forum.com/\.
The site I am testing is a secure site with username and password. And i
have one problem. When i start Selenium tests from a ruby program then a
new browser is opened, and this browser is cleen like a freshly
installed firefox browser.
My problem is that the site I am testing gives this error:
Secure Connection Failed
xxx uses an invalid security certificate.
The certificate is not trusted because the issuer certificate is
unknown.
The certificate is only valid for xxx
(Error code: sec_error_unknown_issuer)
This stops my test and i also has to accept this every time, it wont
remember that I acceptet it earlyer because it always starts a fresh
cleen firefox browser.
Is there a way to start the regular browser insted. A browser that
remember that i have acceptet this before?
When i start the test from the Selenium IDE then it uses my regular
browser: I want it to use my regular browser when I start it from a ruby
program to. How do I do that?