1. #1
    Ext User
    Join Date
    Jul 2007
    Vote Rating
    altus34 is on a distinguished road


    Default Selenium RC Testing and waitForCondition


    I try to use selenium RC to test my app.

    The big issue is that Selenium need to know when it can trigger an assertion.
    If the page in page mode no problem but in an Ajax context Selenium need to wait for all remote Ajax call are terminate to trigger new assertion (the famous waitForCondition).

    I not be able to found in the ExtJs API a Manager that can indicate to me if and remote call is in progress so :
    1 - I've missed something
    2 - The remote call can be multiple : through the form submit, the Ajax Object or the Connection object. All this call can be inspectable ?
    3 - If ExtJs don't support this feature what the best solution to add this feature in my code => maybe some javascript AOP concept


  2. #2
    Ext User ritesh.kapse's Avatar
    Join Date
    May 2008
    Pune, India
    Vote Rating
    ritesh.kapse is on a distinguished road


    Exclamation Selenium IDE and Ajax request ?

    Hi all,

    I am creating a test suite in selenium. I have got a grid which takes some random time to load its data. How can I determine, if the grid has finished loading data?

    I am currently using Pause command to do so..

    Can anybody help in this...

  3. #3
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    The Netherlands
    Vote Rating
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of



    @ritesh.kapse: Use waitForCondition to check if the grid body (.x-grid3-body) contains rows.

    @altus34: Selenium is a visual testing tool. You probably shouldn't use it to wait for non-visual stuff. I assume that every request has a purpose (e.g. show grid rows, commit followed by closing a window etc.). Instead of waiting for the request to finish, wait for the visual response.

  4. #4
    Sencha User
    Join Date
    Jul 2011
    Vote Rating
    exejens is on a distinguished road



    Is there a solution now? How can i check (with selenium respectively javascript) if ajax requests are remaining. I don´t see problems in counting currently running ajax requests and providing a method "getNumberOfRunningAjaxRequests()".

    I don´t want to make me thoughts about workarounds for different issues. To be exact i need the info about running ajax requests and the info if a callback method was executed after getting ajax results.

    var executedCallbacks = false;
    var numberOfAjaxRequests = 0;
    new Ext.Ajax.request.send(url, callback) {
     executedCallbacks = false;
     //get response
     //run callback(response)
     executedCallbacks = true;
    So i could forget my workarounds like waiting for specified html tag value or changing css class.