1

When we do a browser set size in protractor what exactly are we setting in the browser ->window - innerwidth and height, document width and height or something else?

I have a test where browser size should be 1366*768. But when I set the size to these values in Protractor, browser size launched is different than what is observed when done manually.

The values highlighted in the image below(shown using developer tool) works for me.

enter image description here

How do I set browser size so as to get browser window of this dimension? Note - I do know how to set browser size in Protractor. Problem is that the size set does not match with required browser size, in this case 1366*768. Refer to image

1

1 Answer 1

3

You can use this for maximum width:

beforeEach(() => {
        browser.manage().deleteAllCookies();
        browser.driver.manage().window().maximize();
    });

Also you can use this: for specific width:

var width = 1366;
var height = 768;
browser.driver.manage().window().setSize(width, height);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.