Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

145
Views
Inspect the browser during a protractor test

I'm trying to write a protractor test with some mocked backend calls. I have one test which is working up to a point and then failing and I just can't seem to inspect it to find out why.

I really want to stop the browser closing so that I can inspect the page, ideally the network tools but at least the html. The browser closes at the end of the test though so I just can't get a look at it. So for sake of argument my test might be like this

describe('a new set of tests', function () {
        beforeEach(function () {
            browser.clearMockModules();
        });

        it('lets do a test, function () {

            browser.addMockModule('accountMockModule', mockInjector.injectAccount,
                dataMocks.mockedAccount,
                dataMocks.mockedAccountDetails);

            login();

            expect(browser.getCurrentUrl()).toMatch('/account');
            
            //works
            someDetails.isDisplayed();
            expect(someDetails.isDisplayed()).toBeTruthy();
            
            accountPage.clickAccountDetails(dataMocks.mockedAccount.id);

            //works
            someDetails.isDisplayed();
            expect(someDetails.isDisplayed()).toBeTruthy();
            expect(browser.getCurrentUrl()).toMatch('/accountDetails');

            accountPage.addressDetailsLink.click();

            //fails
            expect(browser.getCurrentUrl()).toMatch('/accountAddressDetails');
        });
    });

I want to stop the browser closing either before the fails (and comment out where it fails) or after. I tried adding a wait loop but it seems to process it before the test runs and then run the test. Is there a way to leave the browser up & available to inspect for a while ?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!