Results 1 to 5 of 5

Thread: timeout setup in .visible() function

  1. #1

    Default Answered: timeout setup in .visible() function

    Hello,

    I am running Sencha test under nightly build 2.2.1.16 version


    I meet the following problem. When I execute an action, the response time may be over 5 sec. So I wrote the code as follow :

    //Open the contextual menu of the administration departement Object
    ST.element("//span[text()='Administration department']")
    .rightClick();


    //Open the property page of the org unit
    ST.element('menuitem[itemId="_MENUITEM2-10000"]')
    .visible(30000)
    .click();


    It takes around 8 to 10 seconds for the element to be visible after the right click.

    When I run the script, I see that ST does not seems to wait 30sec that the element is visible, after 5 sec the test failed. Like if the parameter I set up (30000) was not taken into account.

    BUT if I set up the timeout time at the level of the scenario in the dedicated menu timeout.png, it works; I see that the application waits for my 8 to 10 seconds and the scenario goes on without error.

    So I have 2 questions :

    - Is this a normal behaviour ?
    - Is there a parameter in the "stc run" command to specify the timeout ? I try " -t 30000" without succes

  2. It will be timing out on evaluating the locator for matches, and not reaching the "visible" check. To allow extra time for the component/element to be located, define a timeout parameter like this:

    Code:
    ST.component('mylocator', 30000)   // Allow up to 30 seconds for component/element to exist.  Completes sooner if a match is found.
        .click();
    On the command line, the timeout ('-t') is the timeout for browser communication, which is different to the timeout in the menu within Sencha Studio - this lets you change the timeout for the Sencha Test Future APIs.

    If you need to allow extra time for lots of components/elements, rather than defining timeout parameters like above (or changing the timeout value in Sencha Studio each time), you can set a global timeout for the Sencha Test Future APIs within your test suite:

    Code:
    describe('My Test Suite', function() {
        beforeAll(function() {
            ST.options.timeout = 10000;    // Change the global timeout for Future APIs to 10 seconds (default is 5 seconds).
        });
    
    
        it('Should find a grid', function() {
            ST.grid('mygrid');
        });
    });

  3. #2
    Sencha - Sales Team daniel.gallo's Avatar
    Join Date
    Apr 2009
    Location
    London, England
    Posts
    369
    Answers
    63

    Default

    It will be timing out on evaluating the locator for matches, and not reaching the "visible" check. To allow extra time for the component/element to be located, define a timeout parameter like this:

    Code:
    ST.component('mylocator', 30000)   // Allow up to 30 seconds for component/element to exist.  Completes sooner if a match is found.
        .click();
    On the command line, the timeout ('-t') is the timeout for browser communication, which is different to the timeout in the menu within Sencha Studio - this lets you change the timeout for the Sencha Test Future APIs.

    If you need to allow extra time for lots of components/elements, rather than defining timeout parameters like above (or changing the timeout value in Sencha Studio each time), you can set a global timeout for the Sencha Test Future APIs within your test suite:

    Code:
    describe('My Test Suite', function() {
        beforeAll(function() {
            ST.options.timeout = 10000;    // Change the global timeout for Future APIs to 10 seconds (default is 5 seconds).
        });
    
    
        it('Should find a grid', function() {
            ST.grid('mygrid');
        });
    });
    Daniel Gallo
    Sales Engineer
    Sencha

  4. #3

    Default

    Awesome !! Thanks a lot

  5. #4

    Default

    Quote Originally Posted by daniel.gallo View Post
    It will be timing out on evaluating the locator for matches, and not reaching the "visible" check. To allow extra time for the component/element to be located, define a timeout parameter like this:
    Code:
    ST.component('mylocator', 30000)   // Allow up to 30 seconds for component/element to exist.  Completes sooner if a match is found.
        .click();
    Hey, is this also possible when using page objects? e.g.: stpo.custompage.myElement(10000); ?

  6. #5
    Sencha - Sales Team daniel.gallo's Avatar
    Join Date
    Apr 2009
    Location
    London, England
    Posts
    369
    Answers
    63

    Default

    Quote Originally Posted by freightgateone View Post
    Hey, is this also possible when using page objects? e.g.: stpo.custompage.myElement(10000); ?
    For the page object itself, you would need to set the timeout separately before referencing the page object. You can reset it back to the default (5 seconds) after.

    Code:
    ST.options.timeout = 20000;
    
    // Wait up to 20 seconds to locate button
    stpo.LoginScreen.loginButton();
    
    ST.options.timeout = 5000;
    Daniel Gallo
    Sales Engineer
    Sencha

Similar Threads

  1. ExtDirect setup issues: cannot resolve function
    By demonshin in forum Ext JS 6.x Q&A
    Replies: 5
    Last Post: 5 Jun 2019, 12:17 AM
  2. Timeout waiting for target(component) to be visible
    By sneha.bhogaraju in forum Q&A
    Replies: 5
    Last Post: 5 Jun 2017, 5:56 AM
  3. Native Javascript Function Setup
    By nmb1106 in forum Sencha GXT Q&A
    Replies: 3
    Last Post: 15 Apr 2014, 2:59 PM
  4. Server TimeOut function for connectivity?
    By anthonyterrell in forum Sencha Touch 2.x: Q&A
    Replies: 3
    Last Post: 27 Jun 2012, 10:44 AM
  5. Access a function declared on Ext.setup
    By ueilat in forum Sencha Touch 1.x: Discussion
    Replies: 3
    Last Post: 4 Aug 2010, 4:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •