DEV Community

Pramod Dutta
Pramod Dutta

Posted on

Protractor Interview Questions and Answers - Part 2 (Top 21+ Questions covered)

In this video, We are going to cover the top 21+ Protractor Interview Questions and Answers with pdf download.

Question 1 : How to perform certain task before running Protractor Test?
Onprepare method will be executed just before starting the execution of any test case.
Helpful in initializing the reporters

onPrepare: function() {

Question 2 : How do you run headless mode browsers in Protractor ?
using --headless options in chrome and firefox arguments

Question 3 : What are the different mouse actions that can be performed?
mouseMove(element, long xOffset, long yOffset)

Question 4 : Write a code to wait for a particular element to be visible on a page using protractor ?
let EC = ExpectedConditions;
let condition = EC.visibilityOf(element("hidden")))
browser.wait(condition, 30000)

Question 5 : Can Protractor handle windows based pop up?
Protractor is a web automation testing tool that supports only web application testing. Therefore, windows pop up cannot be handled using Protractor.

Question 6 : How to return Javascript execution result ?
browser.executeScript("document.title"); will return null, but:
browser.executeScript("return document.title"); will return the title of the document

Question 7 : How to fetch the current page URL in Protractor ?
console.log("Web page url is : " +url )

Question 8 : How To Check If An Element Is Visible With Protractor?
console.log("element is Visible")
console.log("element is not visible")

Question 11 : How To Switch Between Frames using Protractor?

Question 13 : What is directConnect in protractor conf.js file ?
directConnect is a conf.js file parameter; If true, Protractor will connect directly to the browser Drivers at the locations specified by chromeDriver and firefoxPath.

Only Chrome and Firefox are supported for direct connect.

directConnect: false/true,

Question 14 : How do you set the geckodriver path in protractor ?
geckoDriver location is used to help find the geckodriver.exe file. This will be passed to the Selenium jar as the system property webdriver.gecko.driver.

If the value is not set when launching locally, it will use the default values downloaded from the webdriver-manager.

geckoDriver: 'D:/Eclipse progs/driverserver/geckodriver.exe',

Question 15 : What is maxInstances in protractor ?
A maximum number of browser instances that can run in parallel for this set of capabilities.

This is only needed if sharedTestFiles is true in conf.js file

👪 Join our Community -

✅ Automation Community -

🐦Follow us on Twitter -

📖 Like us on Facebook -

🎤 Listen to our Podcast -

automationtesting #manualtesting #testautomation #thetestingacademy #scrolltest


🚀 Tools and services I recommend:
Some of the courses that I recommend to become better Automation Tester 🙌🙌

✅Selenium Training and Certification -

✅Learn Jenkins for QA -

✅Programming Java -

✅Test Automation -

✅API Testing -

✅Cypress Tutorial with LIVE Projects -

Top comments (0)