The watir button/buttons methods support both kinds of HTML buttons. Or at least they have and they should.
On Oct 9, 8:38 am, SuperKevy <[email protected]> wrote: > From the w3c schools > > Definition and Usage > The <button> tag defines a push button. > > Inside a button element you can put content, like text or images. This > is the difference between this element and buttons created with the > input element. > > Always specify the type attribute for the button. The default type for > Internet Explorer is "button", while in other browsers (and in the W3C > specification) it is "submit > > Browser Support > > The <button> tag is supported in all major browsers. > > Important: If you use the button element in an HTML form, different > browsers will submit different values. Internet Explorer will submit > the text between the <button> and </button> tags, while other browsers > will submit the content of the value attribute. Use the input element > to create buttons in an HTML form. > > Good html code that compiles to a common standard makes a > difference... > > On Oct 9, 4:16 am, kat <[email protected]> wrote: > > > Unfortunately, I cannot change html. > > Also, this is a real bug. I've submitted it here: > > tohttp://jira.openqa.org/browse/WTR-326 > > > On Oct 8, 11:25 pm, orde <[email protected]> wrote: > > > > Weird. Looks like it's returning the text (i.e. "1st button") instead > > > of the value ("first button"). > > > > I'm not sure why you are getting unexpected results, but here are a > > > couple of things that might help: > > > > * <button> tag isn't the same as <input type="button"> tag > > > * your code below should work if all the buttons are <input > > > type="button">, like this: > > > > <input type="button" id="1" value="1 button"> > > > <input type="button" id="2" value="2 button"> > > > <input type="button" id="3" value="3 button"> > > > > Hope that helps. > > > > orde > > > > On Oct 7, 6:11 am, kat <[email protected]> wrote: > > > > > Watir:Buttons is supposed to return all buttons on a page. > > > > With the next tested page > > > > > <html> > > > > <title>some title</title> > > > > <body> > > > > <br> > > > > <button id="1" value="first button">1st button</button> > > > > some text > > > > <button id="2" value="second button">2nd button</button> > > > > <input type="button" id="6" value="6th button"> > > > > </body> > > > > </html> > > > > > using this script: > > > > > require 'watir' > > > > test_site = 'http://localhost/test.html' > > > > ie = Watir::IE.new > > > > ie.goto(test_site) > > > > ie.buttons.each do |a_button| > > > > puts a_button.value > > > > end > > > > > I get only "1st button" in output. > > > > Do I do something wrong or this is a bug?- Hide quoted text - > > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to [email protected] Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/watir-general -~----------~----~----~----~------~----~------~--~---
