Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>i am little confused with your question at " :the Ajax dropdown list is visible but it is not selected "</p> <p>this sounds like that the element is disabled. (Java coding)</p> <p>if so <code>selenium.isElementDisabled()</code> </p> <p>if not then, </p> <p>1) programming laguage solution using while loop and <code>isElementPresent()</code> OR <code>isElementDisabled()</code> </p> <pre><code> //trigger the Ajax request and then long initialTime = System.currentTimeMillis(); do{ thread.sleep(1000); }while((!selenium.isElementPresent("AjaxElement")) &amp;&amp; (System.getCurrentTimeMillis() - initialTime &lt;= 5000)) ; </code></pre> <p>//some thing like above for client programming solution...but for,</p> <p>2) selenium's inbuilt solution</p> <p>we have a method called <code>waitForCondition("java script to be executed", "time out value");</code> this method loops the javascript statement until it returns true or the supplied time out occurs</p> <p>here the important thing is analyzing the application/Ajax element to find out which particular condition of the element changes.</p> <p>from your explation my guess is this, <code>display=none</code> will be changed to <code>display=block</code> OR <code>disabled=true</code> will be changed to <code>disabled=false</code> OR <code>isReadOnly</code> will be changed to no such attribute ect.....(you need to figure out this)</p> <p>and then, use this <code>attribute = value</code> to build a javascript function as ,</p> <pre><code>selenium.waitForCondition("window.document.getElementById('AJAX ELEMENT').disabled == 'false'", "3000"); </code></pre> <p>you can work out the above statement however you want in your programming language.</p> <pre><code>try { //do the action which triggers the Ajax call selenium.waitForCondition("window.document.getElementById('AJAX ELEMENT[drop down element]').disabled == 'false'", "3000"); //OR selenium.waitForCondition("window.document.getElementById('AJAX ELEMENT').disabled == 'false'", "3000"); } catch(SeleniumException se) { if((se.getMessage()).toLowerCase().contains("timed out") throw //..some a custom exception however your organisation requires } selenium.select("drop down element id", "option id"); </code></pre> <p>and so on.....</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload