SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 2 of 2
  1. #1
    New Member
    Join Date
    May 2014
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Locating checkbox element in a list view

    Using Ruby, watir-webdriver, and Firefox.

    I'm trying to click inside a checkbox that forms the table header row of a list view. The HTML looks like this:

    Code:
    <table class="items">
        <tbody>
            <tr>
                <th class="select">
                    <label>
                        <input id="selectAll" type="checkbox" name="selectAll"></input>
                        <span></span>
                    </label>
    ...
    I want to click inside the check box, which will selects all items (i.e., other table rows).

    I've tried a few things:

    @browser.th(:class, "select")
    @browser.label(:id, "selectAll")

    I get a lot of:
    Watir::Exception::UnknownObjectException: unable to locate element

    Any ideas?

  2. #2
    New Member
    Join Date
    Jul 2016
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0
    I am not able to identify the unique properties of the web checkbox and click on it in a web application. The cell values are not displayed in a table. I have pasted down the properties of the the web checkbox below:

    "Class Name:=WebCheckBox",
    "abs_x:=427",
    "abs_y:=311",
    "checked:=0",
    "class:=tree_data_chk",
    "disabled:=0",
    "height:=13",
    "html id:=",
    "html tag:=INPUT",
    "innerhtml:=",
    "innertext:=",
    "name:=",
    "outerhtml:=<input class=""tree_data_chk"" type=""checkbox"">",
    "outertext:=",
    "title:=",
    "type:=checkbox",
    "value:=on",
    "visible:=True",
    "width:=13",
    "x:=427",
    "y:=235"

    When I spy on the object, the object hierarchy is as follows:
    Browser("name").Page("title").WebCheckbox("class:= tree_data_chk")

    The UI is designed in such a way that there is a header row and below that, there are several rows with data for those header columns. There is a checkbox in all the rows including the header row. If i use the below code, it selects the web checkbox in the header row.

    Browser("name:=xxxxx").Page("title:=xxxxx").WebChe ckBox("class:=tree_header_chk","type:=checkbox","i ndex:=0").Set "ON"

    If i try changing the index to 1, it is again selecting the web checkbox in the header row.But I want to select the very first row which contains data. Please help me with this.

    Thanks.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 09:39 AM.

Copyright BetaSoft Inc.