Interacting with HTML

Hello,
I’m trying to interact with following code so that my Ruby code clicks
the button:

I’ve tried all of the following and can’t get it to work:

@browser.button(:class => ‘gh-p’).click
and
@browser.link(:text => ‘http://csr.ebay.com/cse/sell.jsf"
_sp="m570.l1528’).click

Neither worked. Any help you could off would be greatly appreciated!

P.S.

I know that:
@browser.goto ‘http://csr.ebay.com/cse/sell.jsf" _sp="m570.l1528’

works but I was hoping to learn how to interact with the button verses
going this route…

What gem are you using to navigate web pages?

I’m currently using watir-webdriver.

Side note you reply to every comment wanted to say thanks man!

God bless,
Jameson

Try this and look at the results:

@browser.buttons.each do |button|
[:class, :name, :id].each do |attr|
puts “#{ attr }: #{ button.attribute_value attr }”
end
end

Jameson Yount wrote in post #1142393:

Side note you reply to every comment wanted to say thanks man!

Helping others is a great way to improve your skills :slight_smile:

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs