FAQ
Hi,
I am having a hard time to render the combo elements on the page.
First click to show dropdown list is working, but for the second click
i am always getting element not found.
In my test i have these
selenium.click("css=#program_programmgrs_0_field_combobox-triggerWrap
div");
waitForElementToLoad("css=#boundlist-1022-listEl");
selenium.click("css=#boundlist-1022-listEl>ul>li:nth-child(5)");

for the first click:

<div id="program_programmgrs_0_field_combobox-triggerWrap" class="x-
form-trigger-wrap" role="presentation" style="width: 17px;">
<div id="ext-gen1077" class="x-trigger-index-0 x-form-trigger x-form-
arrow-trigger x-form-trigger-last x-unselectable" role="button"
style="-moz-user-select: -moz-none;"></div>
<div class="x-clear" role="presentation"></div>



for the second click:


<div id="boundlist-1022" class="x-boundlist x-boundlist-floating x-
boundlist-default x-layer x-boundlist-above" style="position:
absolute; left: 413px; top: 765px; z-index: 19001; width: 150px;
height: 161px;" role="listbox" tabindex="-1">
<div id="boundlist-1022-listEl" class="list-ct" style="overflow: auto;
height: 160px;">
<ul>
<li class="x-boundlist-item" role="option">123 Test</li>
<li class="x-boundlist-item" role="option">admin last name admin first
name</li>
<li id="ext-gen1385" class="x-boundlist-item"
role="option">administrator administrator</li>
<li id="ext-gen1384" class="x-boundlist-item" role="option">Altergott
Randy</li>
<li class="x-boundlist-item" role="option" id="ext-gen1386">Borders
Lynn</li>
<li class="x-boundlist-item" role="option" id="ext-gen1387">Burhans
Ted</li>
<li class="x-boundlist-item" role="option" id="ext-gen1388">Collins
Linda</li>
<li class="x-boundlist-item" role="option" id="ext-gen1389">Fingland
Steve</li>
<li class="x-boundlist-item" role="option" id="ext-gen1390">heiskanen
kaarlo</li>
<li class="x-boundlist-item" role="option">Hogan Dan</li>
<li class="x-boundlist-item" role="option">IK-Usr-0502 ln IK-Usr-0502
fn</li>
<li class="x-boundlist-item" role="option">imr-int-0423 ln imr-
int-0423 fn</li>
<li class="x-boundlist-item" role="option">imr-usr-0430a ln imr-
usr-0430a fn</li>
</ul>
</div>
I am able to locate the element using the the xpath finder. But
through the scripti am getting element not foound error.

Could somebody help me out to solve this problem? Is there any thing
i am doing wrong?

Thanks,
Sudha

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

Search Discussions

  • Mary navis at May 24, 2012 at 7:11 am
    Hi,

    I guess there are HTML tage missing before #.
    #program_programmgrs_0_field_combobox-triggerWrapdiv");

    On Wed, May 23, 2012 at 5:46 AM, sudha dintakurty
    wrote:

    Hi,
    I am having a hard time to render the combo elements on the page.
    First click to show dropdown list is working, but for the second click
    i am always getting element not found.
    In my test i have these
    selenium.click("css=#program_programmgrs_0_field_combobox-triggerWrap
    div");
    waitForElementToLoad("css=#boundlist-1022-listEl");
    selenium.click("css=#boundlist-1022-listEl>ul>li:nth-child(5)");

    for the first click:

    <div id="program_programmgrs_0_field_combobox-triggerWrap" class="x-
    form-trigger-wrap" role="presentation" style="width: 17px;">
    <div id="ext-gen1077" class="x-trigger-index-0 x-form-trigger x-form-
    arrow-trigger x-form-trigger-last x-unselectable" role="button"
    style="-moz-user-select: -moz-none;"></div>
    <div class="x-clear" role="presentation"></div>



    for the second click:


    <div id="boundlist-1022" class="x-boundlist x-boundlist-floating x-
    boundlist-default x-layer x-boundlist-above" style="position:
    absolute; left: 413px; top: 765px; z-index: 19001; width: 150px;
    height: 161px;" role="listbox" tabindex="-1">
    <div id="boundlist-1022-listEl" class="list-ct" style="overflow: auto;
    height: 160px;">
    <ul>
    <li class="x-boundlist-item" role="option">123 Test</li>
    <li class="x-boundlist-item" role="option">admin last name admin first
    name</li>
    <li id="ext-gen1385" class="x-boundlist-item"
    role="option">administrator administrator</li>
    <li id="ext-gen1384" class="x-boundlist-item" role="option">Altergott
    Randy</li>
    <li class="x-boundlist-item" role="option" id="ext-gen1386">Borders
    Lynn</li>
    <li class="x-boundlist-item" role="option" id="ext-gen1387">Burhans
    Ted</li>
    <li class="x-boundlist-item" role="option" id="ext-gen1388">Collins
    Linda</li>
    <li class="x-boundlist-item" role="option" id="ext-gen1389">Fingland
    Steve</li>
    <li class="x-boundlist-item" role="option" id="ext-gen1390">heiskanen
    kaarlo</li>
    <li class="x-boundlist-item" role="option">Hogan Dan</li>
    <li class="x-boundlist-item" role="option">IK-Usr-0502 ln IK-Usr-0502
    fn</li>
    <li class="x-boundlist-item" role="option">imr-int-0423 ln imr-
    int-0423 fn</li>
    <li class="x-boundlist-item" role="option">imr-usr-0430a ln imr-
    usr-0430a fn</li>
    </ul>
    </div>
    I am able to locate the element using the the xpath finder. But
    through the scripti am getting element not foound error.

    Could somebody help me out to solve this problem? Is there any thing
    i am doing wrong?

    Thanks,
    Sudha

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.


    --
    With Thanks and Regards,
    Mary.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
  • Mallikarjun Yalagi at May 24, 2012 at 7:16 am
    add Thread.sleep(5000) before that element and check.

    Thanks&Regards
    Mallikarjun Yalagi
    On Thu, May 24, 2012 at 12:41 PM, mary navis wrote:

    Hi,

    I guess there are HTML tage missing before #.
    #program_programmgrs_0_field_combobox-triggerWrapdiv");

    On Wed, May 23, 2012 at 5:46 AM, sudha dintakurty
    wrote:

    Hi,
    I am having a hard time to render the combo elements on the page.
    First click to show dropdown list is working, but for the second click
    i am always getting element not found.
    In my test i have these
    selenium.click("css=#program_programmgrs_0_field_combobox-triggerWrap
    div");
    waitForElementToLoad("css=#boundlist-1022-listEl");
    selenium.click("css=#boundlist-1022-listEl>ul>li:nth-child(5)");

    for the first click:

    <div id="program_programmgrs_0_field_combobox-triggerWrap" class="x-
    form-trigger-wrap" role="presentation" style="width: 17px;">
    <div id="ext-gen1077" class="x-trigger-index-0 x-form-trigger x-form-
    arrow-trigger x-form-trigger-last x-unselectable" role="button"
    style="-moz-user-select: -moz-none;"></div>
    <div class="x-clear" role="presentation"></div>



    for the second click:


    <div id="boundlist-1022" class="x-boundlist x-boundlist-floating x-
    boundlist-default x-layer x-boundlist-above" style="position:
    absolute; left: 413px; top: 765px; z-index: 19001; width: 150px;
    height: 161px;" role="listbox" tabindex="-1">
    <div id="boundlist-1022-listEl" class="list-ct" style="overflow: auto;
    height: 160px;">
    <ul>
    <li class="x-boundlist-item" role="option">123 Test</li>
    <li class="x-boundlist-item" role="option">admin last name admin first
    name</li>
    <li id="ext-gen1385" class="x-boundlist-item"
    role="option">administrator administrator</li>
    <li id="ext-gen1384" class="x-boundlist-item" role="option">Altergott
    Randy</li>
    <li class="x-boundlist-item" role="option" id="ext-gen1386">Borders
    Lynn</li>
    <li class="x-boundlist-item" role="option" id="ext-gen1387">Burhans
    Ted</li>
    <li class="x-boundlist-item" role="option" id="ext-gen1388">Collins
    Linda</li>
    <li class="x-boundlist-item" role="option" id="ext-gen1389">Fingland
    Steve</li>
    <li class="x-boundlist-item" role="option" id="ext-gen1390">heiskanen
    kaarlo</li>
    <li class="x-boundlist-item" role="option">Hogan Dan</li>
    <li class="x-boundlist-item" role="option">IK-Usr-0502 ln IK-Usr-0502
    fn</li>
    <li class="x-boundlist-item" role="option">imr-int-0423 ln imr-
    int-0423 fn</li>
    <li class="x-boundlist-item" role="option">imr-usr-0430a ln imr-
    usr-0430a fn</li>
    </ul>
    </div>
    I am able to locate the element using the the xpath finder. But
    through the scripti am getting element not foound error.

    Could somebody help me out to solve this problem? Is there any thing
    i am doing wrong?

    Thanks,
    Sudha

    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit this group at
    http://groups.google.com/group/selenium-users?hl=en.


    --
    With Thanks and Regards,
    Mary.

    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit this group at
    http://groups.google.com/group/selenium-users?hl=en.
    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
  • Mike Riley at May 24, 2012 at 4:51 pm
    Actually, don't do that. Try selenium.isVisible("") and loop until it is
    visible. I put a Thread.sleep(50) inside the loop to give the browser time
    to let it become visible. I do it all in a wrapper method, since you
    likely need to do this in multiple places, plus it allows for a timeout
    value:


    /**
    * This will wait until a particular element of a page becomes
    visible. It
    * will throw an exception if it does not become visible within the
    allotted
    * time period.
    * @param locator The locator that is currently invisible that we need
    * to wait until it is visible.
    * @param timeout Time in milliseconds to wait before reporting element
    did
    * not become visible by throwing an exception.
    * @throws Exception A Selenium exception or: locator + " never became
    visible."
    */
    public void waitUntilVisible(String locator, int timeout) throws
    Exception
    {
    boolean firstTime = true;
    startTimer(timeout);

    try
    {
    while (!selenium.isVisible(locator))
    {
    if (firstTime)
    firstTime = false; // Don't pause the first time
    else
    {
    if (timerExpired)
    {
    throw new Exception(locator + " never became
    visible.");
    }
    else
    Thread.sleep(50); // Pause and check every .05
    second
    } // else
    } // while
    } // try
    catch (Exception ex)
    { // We need to stop the timer before we report the Exception
    timer.stop();
    throw ex;
    } // catch

    timer.stop();
    } // waitUntilVisible(String locator, int timeout) throws Exception

    I'll leave the setting up of the timer to you, as it is fairly standard
    Java code.

    Enjoy!

    Mike
    On Thursday, May 24, 2012 12:16:20 AM UTC-7, Mallikarjun Yalagi wrote:

    add Thread.sleep(5000) before that element and check.

    Thanks&Regards
    Mallikarjun Yalagi
    On Thu, May 24, 2012 at 12:41 PM, mary navis wrote:

    Hi,

    I guess there are HTML tage missing before #.
    #program_programmgrs_0_field_combobox-triggerWrapdiv");

    On Wed, May 23, 2012 at 5:46 AM, sudha dintakurty
    wrote:

    Hi,
    I am having a hard time to render the combo elements on the page.
    First click to show dropdown list is working, but for the second click
    i am always getting element not found.
    In my test i have these
    selenium.click("css=#program_programmgrs_0_field_combobox-triggerWrap
    div");
    waitForElementToLoad("css=#boundlist-1022-listEl");
    selenium.click("css=#boundlist-1022-listEl>ul>li:nth-child(5)");

    for the first click:

    <div id="program_programmgrs_0_field_combobox-triggerWrap" class="x-
    form-trigger-wrap" role="presentation" style="width: 17px;">
    <div id="ext-gen1077" class="x-trigger-index-0 x-form-trigger x-form-
    arrow-trigger x-form-trigger-last x-unselectable" role="button"
    style="-moz-user-select: -moz-none;"></div>
    <div class="x-clear" role="presentation"></div>



    for the second click:


    <div id="boundlist-1022" class="x-boundlist x-boundlist-floating x-
    boundlist-default x-layer x-boundlist-above" style="position:
    absolute; left: 413px; top: 765px; z-index: 19001; width: 150px;
    height: 161px;" role="listbox" tabindex="-1">
    <div id="boundlist-1022-listEl" class="list-ct" style="overflow: auto;
    height: 160px;">
    <ul>
    <li class="x-boundlist-item" role="option">123 Test</li>
    <li class="x-boundlist-item" role="option">admin last name admin first
    name</li>
    <li id="ext-gen1385" class="x-boundlist-item"
    role="option">administrator administrator</li>
    <li id="ext-gen1384" class="x-boundlist-item" role="option">Altergott
    Randy</li>
    <li class="x-boundlist-item" role="option" id="ext-gen1386">Borders
    Lynn</li>
    <li class="x-boundlist-item" role="option" id="ext-gen1387">Burhans
    Ted</li>
    <li class="x-boundlist-item" role="option" id="ext-gen1388">Collins
    Linda</li>
    <li class="x-boundlist-item" role="option" id="ext-gen1389">Fingland
    Steve</li>
    <li class="x-boundlist-item" role="option" id="ext-gen1390">heiskanen
    kaarlo</li>
    <li class="x-boundlist-item" role="option">Hogan Dan</li>
    <li class="x-boundlist-item" role="option">IK-Usr-0502 ln IK-Usr-0502
    fn</li>
    <li class="x-boundlist-item" role="option">imr-int-0423 ln imr-
    int-0423 fn</li>
    <li class="x-boundlist-item" role="option">imr-usr-0430a ln imr-
    usr-0430a fn</li>
    </ul>
    </div>
    I am able to locate the element using the the xpath finder. But
    through the scripti am getting element not foound error.

    Could somebody help me out to solve this problem? Is there any thing
    i am doing wrong?

    Thanks,
    Sudha

    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit this group at
    http://groups.google.com/group/selenium-users?hl=en.


    --
    With Thanks and Regards,
    Mary.

    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit this group at
    http://groups.google.com/group/selenium-users?hl=en.
    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/K56KYzJVt8oJ.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupselenium-users @
categoriesselenium
postedMay 23, '12 at 6:31p
activeMay 24, '12 at 4:51p
posts4
users4
websiteseleniumhq.org

People

Translate

site design / logo © 2022 Grokbase