Issue with Selenium-webdriver

Hi,

I wrote a script and it was running fine. But from today it stopped
working.

This is the part of the script:

========================================
require ‘selenium-webdriver’
require ‘win32ole’

driver = Selenium::WebDriver.for :firefox
begin
driver.get “https://example.com/
rescue Selenium::WebDriver::Timeout::Error
driver.manage.timeouts.page_load = 10
end

element = driver.find_element :name => “username”
element.send_keys “"
element = driver.find_element :name => “password”
element.send_keys "
***”
element.submit

It’s giving me continuous error:

C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:146:in `rescue in rbuf_fill’:
Timeout::Error (Timeout::Error)

I tried to handle it,but still not handled properly. What could be the
reason?

I am using “selenium-webdriver (2.30.0, 2.27.2)” with “Firefox 12.0” and
“ruby 1.9.3p374 (2013-01-15) [i386-mingw32]”

Thanks

It means you timed out trying to access the URL.
In your given case, that would be because “https://example.com/” doesn’t
exist.

This is often a firewall issue or the site being unavailable at the time
the page request was made.

If it’s started happening after an update, it could also be that you’re
mismatching versions of Firefox and Webdriver.

Inside my loop, I have statements like below:

============================
elems =
driver.find_elements(:xpath,"//div[contains(@id,‘20120692.outline’)]/input")
puts elems[1].attribute(:value),elems[1]
elems[0].click if elems[1].attribute(:value) == “No”
puts elems[1].attribute(:value),elems[1]

============================

It outputs when I ran the script:

Yes
#Selenium::WebDriver::Element:0x17a1860
Yes
#Selenium::WebDriver::Element:0x17a1860
No
#Selenium::WebDriver::Element:0x1640eb0
1 #<~~~ why one here? I expect Yes.Looking at the webpage I can see that
check-box getting checked. But from where 1 comes out?


HTML :

Thanks

The one isn’t coming from anywhere in the code you posted. It would have
to come from a line underneath your last one.

Your HTML omits the script for the function “setBooleanValue” as well,
this might be related.

Joel P. wrote in post #1107340:

The one isn’t coming from anywhere in the code you posted. It would have
to come from a line underneath your last one.

Your HTML omits the script for the function “setBooleanValue” as well,
this might be related.

Basically when the check box is checked,it prints Yes Yes, but
when unchecked,first prints No, as expected,then 1 - which is
confusing.

But I am getting. Don’t know the reason :frowning:

C:\Documents and Settingsby\Scripts>business_hierarchy_updation.rb
Yes
#Selenium::WebDriver::Element:0x11092f8
Yes
#Selenium::WebDriver::Element:0x11092f8
“Supplier Edit Location Request”
No
#Selenium::WebDriver::Element:0x15c8ce8
1
#Selenium::WebDriver::Element:0x15c8ce8
“Supplier Edit Location Request”
Time Duration:- 6

C:\Documents and Settingsby\Scripts>

I ran a test using the HTML and code provided. No “1” appeared.

I wrote the below line :

bol = driver.find_elements(:class, “hierarchyTextBox”).all? do |el|
el.attribute(:value) == “”;
end
p bol
driver.find_element(:class, “nice small white radius button”).click if
bol == false

But getting error as :

`unknown’: Compound class names not permitted
(Selenium::WebDriver::Error::UnknownError)

HTML:

What could be the reason?

I expect that “nice small white radius button” isn’t recognised as valid
HTML because it has spaces in it.