Obtaining class type of a FormElement

15 views
Skip to first unread message

Samuel Rossinovic

unread,
Feb 27, 2018, 5:40:18 PM2/27/18
to Geb User Mailing List
Hi.
given:

<form>
   
<input type="text" name="a"/>
   
<input type="checkbox" name="b"/>
</form>


class Foo extends Page {
static content = {
   
form { $('form') }
    cb { form.$(name:'b').module Checkbox }
    text { form.a() }
 }
}


How can the type of input of 'cb' & 'text' be obtained?
(reason I'm after the type is needing to handle modification of that input: a text input can be modified by assigning it a unique string. A checkbox must be toggled).
Thanks!
Sam

Marcin Erdmann

unread,
Mar 6, 2018, 3:12:51 PM3/6/18
to Geb User Mailing List
If you are after the type attribute of the elements returned by `cb` and `text` content definitions then cb.attr('type') or cb.@type should do the job (see http://gebish.org/manual/current/#accessing-tag-name-attributes-text-and-classes).

--
You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+unsubscribe@googlegroups.com.
To post to this group, send email to geb-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/7033e072-3dbd-475a-9a85-996f36c74ed7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages