The degreeSelector displays the html of the List -- not the html that
is in the source after the degree list is clicked.

Diagnosis Result for DegreeInformationClickedForm.degreeSelector

-------------------------------------------------------

        Matching count: 1

        Match Elements:

        --- Element 1 -->

<ol alt="fakefield_20" title=""
id="aspect_vireo_admin_View_field_degree" class="fakeField fakeSelect
ds-select-field degree editable"><li class="hidden" id="">none</li><li
class="selected" id="Test Degree4">Test Degree4</li><li class="hidden"
id="Test Degree3">Test Degree3</li><li class="hidden" id="Test
Degree2">Test Degree2</li><li class="hidden" id="Business">Business</
li><li class="hidden" id="Computer Science">Computer Science</li><li
class="hidden" id="Test Degree1">Test Degree1</li></ol>

Jade


On Sep 2, 6:40 pm, Jian Fang <[email protected]> wrote:
> Looked at Tellurium APIs and seems getSelectedIndex is not implemented in
> Tellurium Engine. You must be using Selenium APIs.
> Still need the log to see what locator you passed in and the html source.
>
> Thanks,
>
> Jian
>
> On Thu, Sep 2, 2010 at 7:32 PM, Jian Fang <[email protected]> wrote:
> > Are you using Selenium APIs or Tellurium new Engine?
>
> > Could you post the log for the getSelectedIndex command?
>
> > Also, please post the html for the selector by calling
>
> > getHTMLSource(uid)
>
> > Thanks,
>
> > Jian
>
> > On Thu, Sep 2, 2010 at 4:59 PM, Jade <[email protected]> wrote:
>
> >> Thanks. It's partially working now. getSelectedIndex is returning 48
> >> even though the first item is selected and there are only 7 items in
> >> the list.
>
> >> Here's the method:
>
> >> public static void selectClickableOption(final String listUid, final
> >> String selectorId,
> >>         final DslContext module, final int indx, boolean shouldFail) {
>
> >>                 // With Ajax, the module has to be clicked on so the uid
> >> is found.
> >>                module.click listUid
>
> >>                 int len = module.getSelectOptions(selectorId).size()
>
> >>                log.info("selector size (" + selectorId + "): " + len);
>
> >>                if (indx > len) {
> >>                        fail("${indx} > selector size, ${selectorId}, size:
> >> ${len}")
> >>                }
>
> >>                String origValue = module.getSelectedValue(selectorId)
> >>                int origIndx = module.getSelectedIndex(selectorId);
> >>                module.selectByIndex(selectorId, indx);
>
> >>                int selected = module.getSelectedIndex(selectorId);
>
> >>                if (shouldFail) {
> >>                        assertEquals("selectOption: selecting ${indx} for
> >> ${selectorId}
> >> should have failed", origIndx, selected);
> >>                } else {
> >>                        assertEquals("selectOption: selecting ${indx} for
> >> ${selectorId}
> >> should have succeeded", indx, selected);
> >>                }
> >>        }
>
> >> Here's my module definition in case someone else following this thread
> >> is interested:
>
> >>        public void defineModule() {
> >>                ui.Form(uid: "DegreeInformationForm", clocator: [tag:
> >> "form",
> >> method: "post", action: "${postAction}", class: "ds-interactive-div
> >> view-form", id: "aspect_vireo_admin_View_div_view-form"]) {
> >>                        InputBox(uid: "committee_member_2", clocator: [tag:
> >> "input", id:
> >> "aspect_vireo_admin_View_field_committee-member-2", type: "text"],
> >> respond: ["click"])
> >>                        InputBox(uid: "committee_member_1", clocator: [tag:
> >> "input", id:
> >> "aspect_vireo_admin_View_field_committee-member-1", type: "text"],
> >> respond: ["click"])
>
> >>                        List(uid: "degree", clocator: [tag: "ol", id:
> >> "aspect_vireo_admin_View_field_degree"], separator: "li") {
> >>                                 Container(uid: "{all}", clocator: [:])
> >>                        }
> >>                        InputBox(uid: "school", clocator: [tag: "input",
> >> id:
> >> "aspect_vireo_admin_View_field_school", type: "text"], respond:
> >> ["click"])
> >>                        InputBox(uid: "committee_email", clocator: [tag:
> >> "input", id:
> >> "aspect_vireo_admin_View_field_committee-email", type: "text"],
> >> respond: ["click"])
> >>                        InputBox(uid: "department", clocator: [tag:
> >> "input", id:
> >> "aspect_vireo_admin_View_field_department", type: "text"], respond:
> >> ["click"])
>
> >>                        List(uid: "college", clocator: [tag: "ol", id:
> >> "aspect_vireo_admin_View_field_college"], separator: "li", respond:
> >> ["click"]) {
> >>                                Container(uid: "{all}", clocator: [:])
> >>                        }
> >>                        InputBox(uid: "committee_member_3", clocator: [tag:
> >> "input", id:
> >> "aspect_vireo_admin_View_field_committee-member-3", type: "text"],
> >> respond: ["click"])
> >>                        InputBox(uid: "discipline", clocator: [tag:
> >> "input", id:
> >> "aspect_vireo_admin_View_field_discipline", type: "text"], respond:
> >> ["click"])
> >>                        InputBox(uid: "semester", clocator: [tag: "input",
> >> id:
> >> "aspect_vireo_admin_View_field_semester", type: "text"], respond:
> >> ["click"])
>
> >>                        List(uid: "degreeLevel", clocator: [tag: "ol", id:
> >> "aspect_vireo_admin_View_field_degreeLevel"], separator: "li",
> >> respond: ["click"]) {
> >>                                Container(uid: "{all}", clocator: [:])
> >>                        }
> >>                }
>
> >>                 //Since ajax changes the html when a list is clicked, this
> >> module is
> >> required to represent clickable lists once they've been clicked.
> >>                //  For more information, see:
>
> >>http://groups.google.com/group/tellurium-users/browse_thread/thread/9...
> >>                //
> >>                ui.Form(uid: "DegreeInformationClickedForm", clocator:
> >> [tag: "form",
> >> method: "post", action: "${postAction}", class: "ds-interactive-div
> >> view-form", id: "aspect_vireo_admin_View_div_view-form"]) {
>
> >>                         Selector(uid: "degreeSelector", clocator: [id:
> >> "aspect_vireo_admin_View_field_degree"])
> >>                         Selector(uid: "collegeSelector", clocator: [id:
> >> "aspect_vireo_admin_View_field_college"])
> >>                        Selector(uid: "degreeLevelSelector", clocator: [id:
> >> "aspect_vireo_admin_View_field_degreeLevel"])
> >>                 }
>
> >> On Sep 2, 3:24 pm, Jian Fang <[email protected]> wrote:
> >> > Good question. In one UI module file, you can defined multiple UI
> >> modules, I
> >> > mean the UIs.
> >> > For instance:
>
> >> >     ui.Table(uid: "keyValue", clocator: [class: "keyValueTable"]){
> >> >       TextBox(uid: "{row: any, column: 1} as p1, var key", clocator:
> >> [text:
> >> > "key"], self: "true")
> >> >       TextBox(uid: "{row: any, column: 2} as p2, var value", clocator:
> >> > [text: "value"], self: "true")
> >> >     }
>
> >> >     ui.List(uid: "Views", clocator: [tag: "div", id: "view"], separator:
> >> > "p"){
> >> >       UrlLink(uid: "{any}, var view_id", clocator: [id: "view_id", text:
> >> > "View"])
> >> >     }
>
> >> > Each UI module starting with a "ui." is a separate one. But be aware
> >> that
> >> > you cannot have
> >> > two UI modules have the same name on the top level.
>
> >> > Thanks,
>
> >> > Jian
>
> >> > On Thu, Sep 2, 2010 at 4:13 PM, Jade <[email protected]> wrote:
> >> > > That would be great! I'm really enjoying using tellurium for testing.
> >> > > Thank you to the team for all of your awesome work!
>
> >> > > BTW,  I need to pass both modules to the method that has both list and
> >> > > selector calls such as:
> >> > > module.click listUid
> >> > > selectModule.getSelectOptions(selectorId)
>
> >> > > However, now that the code in in both modules, I'm not sure how to get
> >> > > a handle of the second module from my data driven tests?
>
> >> > > From the module that defines the List, I call the method passing in
> >> > > "this" for the module that defines the test. "this" gets mapped to
> >> > > module in the actual method.
>
> >> > > This is my function call in my module test_degree test definition:
>
> >>  TestingUtils.selectClickableOption("DegreeInformationForm.degree",
> >> > > "DegreeInformationClickedForm.degreeSelector", this, indxToTest,
> >> > > shouldFail)
>
> >> > > Within this function, I need to refer to the second module that
> >> > > includes the Selector definitions but I don't know how to do that in a
> >> > > data driven test environment?
>
> >> > > I've also tried including the second module but perhaps that only
> >> > > works with modules that aren't data driven. The include code is:
>
> >> > >                        Include(uid: "DISelectorsModule", ref:
> >> > > "DegreeInformationSelectorsModule").
>
> >> > > and the error is:
>
> >> > > org.telluriumsource.exception.UiObjectNotFoundException: Cannot find
> >> > > UI Object DegreeInformationSelectorsModule
>
> >> > > Jade
>
> >> > > On Sep 2, 12:08 pm, Jian Fang <[email protected]> wrote:
> >> > > > The option object may need to be updated to handle this scenario.
> >> Your
> >> > > > problem presents an
> >> > > > excellent user case for use of the option object. I will take a look
> >> and
> >> > > see
> >> > > > how to improve it some time later.
>
> >> > > > Thanks,
>
> >> > > > Jian
>
> >> > > > On Thu, Sep 2, 2010 at 12:55 PM, Jade <[email protected]> wrote:
> >> > > > > Hi Jian,
>
> >> > > > > I first tried the option object; Is this definition correct?
>
> >> > > > > Option(uid: "degree") {
> >> > > > >                                 Selector(uid: "degree", clocator:
> >> [id:
> >> > > > > "aspect_vireo_admin_View_field_degree"])
>
> >> > > > >                                List(uid: "degree", clocator: [tag:
> >> > > "ol",
> >> > > > > id:
> >> > > > > "aspect_vireo_admin_View_field_degree"], separator: "li") {
> >> > > > >                                        Container(uid: "{all}",
> >> > > clocator:
> >> > > > > [:])
> >> > > > >                                }
> >> > > > >                        }
>
> >> > > > > If so, this call,
> >> getSelectOptions("DegreeInformationForm.degree"),
> >> > > > > gives me an error (as you thought it might) No signature of
> >> method:
> >> > > > > org.telluriumsource.ui.object.UiObject.getSelectOptions() is
> >> > > > > applicable for argument types:
> >> (org.telluriumsource.dsl.BaseDslContext
> >> > > > > $_getSelectOptions_closure27) values:
> >> > > > > [org.telluriumsource.dsl.BaseDslContext
> >> > > > > $_getselectoptions_closur...@67ee75a5]
> >> > > > > sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> >> Method)
>
> >> > > > > so I'll try defining two Modules and including both of them and
> >> > > > > referring to the Selection once the user has clicked on the list.
>
> >> > > > > Jade
>
> >> > > > > On Sep 2, 11:20 am, Jian Fang <[email protected]> wrote:
> >> > > > > > Hi
>
> ...
>
> read more »

-- 
You received this message because you are subscribed to the Google Groups 
"tellurium-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tellurium-users?hl=en.

Reply via email to