Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
in DevOps and Agile by (19.7k points)

Every protractor example I can find on the internet seems to use the browser.get with a web URI.


I'd like to use Selenium to simply navigate to a file:// path so that I don't need a local webserver running in order to perform tests. All I need is a simple HTML page and some assets.

That doesn't seem to work though.


When I paste that URI into my browser window I get an HTML page. When I try to open it with protractor I get a timeout. How can I run tests on this page with a protractor? The ideal answer will work with a relative file path from the myproject root.

1 Answer

0 votes
by (62.9k points)

I have had the same error, it got resolved by removing the baseUrl. Here is my setup:



exports.config = {


  capabilities: {

    browserName: 'chrome'



  specs: [




  onPrepare: function() {

    // By default, Protractor use data:text/html,<html></html> as resetUrl, but 

    // location.replace from the data: to the file: protocol is not allowed

    // (we'll get ‘not allowed local resource’ error), so we replace resetUrl with the one

    // with the file: protocol (this  will open root folder of the system)

    browser.ignoreSynchronization = true;



    browser.resetUrl = 'file:///';






'use strict';


describe("Buttons' tests are being started", function() {


    it('Must return 20 records into table', function() {




        /* Test codes here */





Browse Categories