0

im trying to execute this tests and I got: 'Failed: Script timeout' and i don't undesrstand where is the error, literally i have do copy paste, in the last test case is working, but in this code i got that error. Thanks in advance.

        var name_filter = browser.element(by.xpath(browser.params.constants.GENERALPATHS.CATALOG.NAMEFILTER));
        var seriestitle_filter = browser.element(by.xpath(browser.params.constants.GENERALPATHS.CATALOG.SERIESTITLEFILTER));
        var catalog_title = browser.element(by.xpath(browser.params.constants.GENERALPATHS.CATALOG.CATALOGTITLE));
        
        await browser.wait(EC.elementToBeClickable(name_filter), waitLongTime);
        await browser.wait(EC.elementToBeClickable(seriestitle_filter), waitLongTime);
        
        var catalogues = await element.all(by.className('ui-grid-cell-contents ng-binding ng-scope'));
        
        for(var i=0; i<catalogues.length; i++) {
            var catalogue_text = await catalogues[i].getText();
    
            await catalogues[i].click();
    
            await browser.wait(EC.elementToBeClickable(name_filter), waitLongTime);
            await browser.wait(EC.elementToBeClickable(seriestitle_filter), waitLongTime);
    
            expect(catalog_title).toEqual(catalogue_text);
        }
Mario Ramos García
  • 755
  • 3
  • 8
  • 20

1 Answers1

0

I've given a recommendation to you some time ago to switch to async/await. I see you're using that, and I hope that made your experience working with protractor better

Unfortunately I can't give you direct answer to your question again, because the script may be causing problems in any line and no way to find out where exactly without the app you're testing. Additionally, there may be a few problems related your config.

However, I tend to help to solve problems with the processes people choose for test development

In this example, I highly recommend you to setup a run configuration in webstorm or vs studio. This will allow you to execute any script line by line, explore variables etc. If you do that, you can easily find the line where you script fails and troubleshoot immediately. If you find the line with the problem but still don't understand why it happens, let me know, I'll try to walk you through the steps I'd do to figure out the issue

Hope it helps, and sorry for a vague answer

Sergey Pleshakov
  • 7,964
  • 2
  • 17
  • 40