Interview Questions.

Top 100+ Phantomjs Interview Questions And Answers

fluid

Top 100+ Phantomjs Interview Questions And Answers

Question 1. What Is Phantomjs?

Answer :

PhantomJS is a light-weight headless scripted browser constructed on WebKit. It is used for automation net web page interplay.

Question 2. Why It Is Called As Headless Browser?

Answer :

PhantomJS known as as headless browser as it execution does now not happen on browser this means that there may be no involvement of browser while executing JavaScript code, it takes over terminal.

Java Script Interview Questions
Question 3. What Is Webkit?

Answer :

WebKit is software component used for rendering web pages in internet browsers (Chrome, Safari as well as other).

Question 4. What Are The Objects In Phantomjs?

Answer :

These are the subsequent gadgets in PhantomJs:

cookiesEnabled: It take a look at whether or not cookie are permit or now not. It return actual for yes otherwise fake. Its default fee is real.

Syntax:

phantom.CookiesEnabled  

cookies: It is used to get or set cookies from domain which can be stored in Cookiejar. Cookie returns an object with all cookies available for the area.

Syntax:

phantom.Cookies  

libraryPath: It shop the script path which might be utilized by injectJs function.

Syntax:

phantom.LibraryPath  

model: It is a examine-best property which return model of PhantomJS example which are going for walks. The information are go back in an item ('important': 1,'minor': 7, 'patch': zero).

Syntax:

phantom.Version  

scriptName: It is used to get cutting-edge script name (this assets has depreciated).

Syntax:

phantom.ScriptName  

args: It comprise the script call as its first element (this assets has eliminated).

Syntax:

phantom.Args  

Java Script Tutorial
Question five. Name Some Method Of Phantomjs?

Answer :

Following strategies are assisting us to execute JavaScript with out the browser:

addCookie: This method is used for adding cookies in CookieJar. If efficiently brought it go back actual otherwise fake.

Phantom.AddCookie(  

    'call' : 'Cookie name',  

    'value' : 'Cookie price',  

    'area' : 'localhost'  

);  

clearCookies: This method used to delete all of the cookies from Cookiejar.

Phantom.ClearCookies();  

deleteCookie: It is used for deleting cookie from Cookiejar via the use of 'call' assets

matching chookieName.  

Phantom.DeleteCookie('Cookie name');  

go out: This technique exit the program whilst go back unique go back value. It there may be no unique go back cost it return '0'.

Precise go back fee it return '0'.  

If(condation)  

    phantom.Go out(1);  

else  

phantom.Exit(zero):  

  

injectJs: It injects external report from particular report into phantom. If record does no longer located in cutting-edge listing, then libraryPath property of Phantos is used as an additional location to music the route.

Var addSuccess= phantom.InjectJs(filename);  

consol.Log(addSuccess);  

phantom.Exit();  

Angular JS Interview Questions
Question 6. What Is Webpage Module Property? Name Some Of Them?

Answer :

Webpage module property affords a facility to interact with contents inside a website.

Some module residences are:

canGoBack
canGoForward
clipRect
Content
Cookies
customHeaders
Even
focusedFrameName
frameContent
frameName
and so on.

Question 7. What Is Webpage Module Method? Name Some Of Them?

Answer :

Webpage module keeps the method for Cookies, Frames, Page Navigation, Reload, Rendering and Uploading of Files.

Some website module strategies are:

addCookie()
clearCookies()
deleteCookie()
getPage()
goBack()
goForword()
move()
consists of()
injectJs()
childFramesCount()
childFramesName()
currentFrameName() and so forth.
Ext JS Tutorial Ext JS Interview Questions
Question 8. What Do You Understand About Screen Capture?

Answer :

PhantomJs provide facility seize screenshot of web page. This capture photograph may be saved in one-of-a-kind formate which includes .Png, .Jpeg, .Pdf, .Gif. It is also able to convert as PDF.

Following script display the simple way for display screen seize.

Var page = require(‘webpage’).Create();  

page.Open(‘website_url’,characteristic(fame)  

web page.Render(‘imagename.Png’);  

phantom.Exit();  

);  

Question nine. How Network Monitoring Is Done In Phantomjs?

Answer :

Network monitoring is executed via using events including onResourceRequested and DOM manipulation. This allows in monitoring the visitors for given page.

Node.Js Interview Questions
Question 10. What Is Page Automation?

Answer :

Manipulating and loading of internet pages and acting operation which includes DOM manipulation by way of clicking buttons, and so on.

Node.Js Tutorial
Question eleven. Is Phantomjs Support Command Line Interface (cli) Execution?

Answer :

Yes, PhantomJS help command line interface execution. CLI execution is accomplished by the usage of keyword "phantomjs" with document call. For example: "phantomjs filename.Js".

Java Abstraction Interview Questions
Question 12. What Is The Role Of Child Process Module In Phantomjs?

Answer :

Child manner module helps to engage with sub techniques the use of stdin /stdout/ stderr. Child tactics can be used for performing venture like invoke applications, printing, or to sending mail.

Java Script Interview Questions
Question 13. What Is Repl?

Answer :

REPL is stands for Read Eval Print Loop. In PhantomJS, REPL is an interactive mode to check the JavaScript code.

Javascript Objects Tutorial
Question 14. How Testing Are Done In Phantomjs?

Answer :

PhantomJS isn't a take a look at framework. PhantomJS use special libraries called check runner for trying out.

Some of the framework together with their take a look at runner is:

Framework   -Test Runner

Capybara         Poltergeit, Terminus

Buster.JS         integrated

Mocha             Chutzpah, mocha-phantoms

Jasmine          Chutzpah, grunt-contrib-jasmine

Hiro                built-in

WebDriver      GhostDriver

Question 15.  What Is File System Module In Phantomjs?

Answer :

File gadget module perform operations on documents and directories. We can create, write and delete a files and listing.

There are two residences in record gadget module:

Separator: It is used for document paths (for home windows: , for linux: /).

Working Directory: It is a listing in which PhantomJS executes.

Javascript Objects Interview Questions




CFG