Is it possible to display all available properties of a WebElement? I
didn't find anything in the API.
For example, I have the below HTML code source for a WebElement (checkbox
as an 'a' link), I can't detect if it is checked or not:

<a id="mx1254[R:0]" imgid="mx1254[R:0]_img" style="cursor:default" title="Actif
: activé" ctype="checkbox" tabindex="0" href="javascript: void(0)" clicked="
false">
<img id="mx1254[R:0]_img" class="checkbox " border="0" align="texttop"
onfocus="this.parentNode.focus()" readonly="false" style="cursor:default"
checked="checked" imgname="table_cb_" imgtype="gif" src="
../webclient/skins/tivoli09/images/table_cb_checked.gif" tabindex="-1" alt="Actif
: activé">


Thank you.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/fK6BG39HCvcJ.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Javix at Dec 6, 2012 at 1:22 pm
    I tried to use:

    myCheckBox.getAttribute("title")

    but it always returns NULL.

    Any idea ?
    On Thursday, 6 December 2012 14:20:29 UTC+1, Javix wrote:

    Is it possible to display all available properties of a WebElement? I
    didn't find anything in the API.
    For example, I have the below HTML code source for a WebElement (checkbox
    as an 'a' link), I can't detect if it is checked or not:

    <a id="mx1254[R:0]" imgid="mx1254[R:0]_img" style="cursor:default" title="Actif
    : activé" ctype="checkbox" tabindex="0" href="javascript: void(0)" clicked
    ="false">
    <img id="mx1254[R:0]_img" class="checkbox " border="0" align="texttop"
    onfocus="this.parentNode.focus()" readonly="false" style="cursor:default"
    checked="checked" imgname="table_cb_" imgtype="gif" src="
    ../webclient/skins/tivoli09/images/table_cb_checked.gif" tabindex="-1" alt
    ="Actif : activé">


    Thank you.
    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to [email protected].
    To unsubscribe from this group, send email to [email protected].
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/uheGSBLj-WEJ.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Kevin O. at Dec 6, 2012 at 4:39 pm
    You can see a lot of properties in Firebug, etc., but I do not see how that
    will help.
    What I assume you are trying to accomplish is whether the fake checkbox is
    checked or not. Look at the dom change in Firebug in the different states.
    It will probably be the src property on the img that chages. Then you could
    do something like this assuming myCheckBox is pointing to the img element
    and not the a element...
    boollean isChecked =
    myCheckBox.getAttribute("src").contains("table_cb_checked.gif");

    or even better

    public isPseudoCheckboxChecked(WebElement imgElem) {
    String src = imgElem.getAttribute("src");
    if (src.contains("table_cb_checked.gif")) {
    return true;
    else if (src.contains("table_cb_unchecked.gif")) {
    reutnr false;
    else {
    throw new RuntimeException("Unable to determine if pseudeo checkbox
    is checked");
    }
    }

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to [email protected].
    To unsubscribe from this group, send email to [email protected].
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/FC1xny2T8O4J.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Serguei Cambour at Dec 6, 2012 at 7:06 pm
    Yeah, it was 'alt' attribute that changed depending on if the checkbox was
    checked or not. So it is solved by now. Thanks a lot.
    On 6 December 2012 17:39, Kevin O. wrote:

    You can see a lot of properties in Firebug, etc., but I do not see how
    that will help.
    What I assume you are trying to accomplish is whether the fake checkbox is
    checked or not. Look at the dom change in Firebug in the different states.
    It will probably be the src property on the img that chages. Then you could
    do something like this assuming myCheckBox is pointing to the img element
    and not the a element...
    boollean isChecked =
    myCheckBox.getAttribute("src").contains("table_cb_checked.gif");

    or even better

    public isPseudoCheckboxChecked(WebElement imgElem) {
    String src = imgElem.getAttribute("src");
    if (src.contains("table_cb_checked.gif")) {
    return true;
    else if (src.contains("table_cb_unchecked.gif")) {
    reutnr false;
    else {
    throw new RuntimeException("Unable to determine if pseudeo
    checkbox is checked");
    }
    }

    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to [email protected].
    To unsubscribe from this group, send email to
    [email protected].
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/FC1xny2T8O4J.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Selenium 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 https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupselenium-users @
categoriesselenium
postedDec 6, '12 at 1:20p
activeDec 6, '12 at 7:06p
posts4
users2
websiteseleniumhq.org

2 users in discussion

Serguei Cambour: 3 posts Kevin O.: 1 post

People

Translate

site design / logo © 2023 Grokbase