Thank you, Ken and everyone who responded. Ken, you had the answer. I tried my $child = $firefox->find_child_element($elem, "./select/option[\@value='50']"); and then a call to mouse_move_to_location and then to click and when I then retrieved the contents again, the 50 was selected. Thank you.

Note that if you inspect the element rather viewing the source, you'll be able to see what I represented -- which is also found in the $content variable

I have yet another, similar problem (to select an option which, in this case is part of an html "li" child element. Maybe you can help. The html is:

<ul class="listOfChoices"> <li style="display:none" class="clear-filter"><a onclick=" +clearFilter('Condition', 67287, 'yugioh')" href="javascript:void(0)"> +Clear</a></li> <li class=""> <a onclick="changeFilter('Condition', 'NearMint', +67287, 'yugioh')" href="javascript:void(0)"> <span class="option"></span> Near Mint </a> </li> <li class=""> <a onclick="changeFilter('Condition', 'LightlyPlay +ed', 67287, 'yugioh')" href="javascript:void(0)"> <span class="option"></span> Lightly Played </a> </li> ….
and I want to select the "Near Mint" selection. I can find the "listOfChoices" element. I am (as you can tell) not familiar with xpath, but reading through it.

Also, how does one print an element?


In reply to Re^2: Selenium::Firefox: problem finding a child_element by samberman
in thread Selenium::Firefox: problem finding a child_element by samberman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.