Top 100+ Phantomjs Interview Questions And Answers
Question 1. What Is Phantomjs?
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?
Java Script Interview Questions
Question 3. What Is Webkit?
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?
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.
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.
libraryPath: It shop the script path which might be utilized by injectJs function.
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).
scriptName: It is used to get cutting-edge script name (this assets has depreciated).
args: It comprise the script call as its first element (this assets has eliminated).
Java Script Tutorial
Question five. Name Some Method Of Phantomjs?
addCookie: This method is used for adding cookies in CookieJar. If efficiently brought it go back actual otherwise fake.
'call' : 'Cookie name',
'value' : 'Cookie price',
'area' : 'localhost'
clearCookies: This method used to delete all of the cookies from Cookiejar.
deleteCookie: It is used for deleting cookie from Cookiejar via the use of 'call' assets
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'.
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);
Angular JS Interview Questions
Question 6. What Is Webpage Module Property? Name Some Of Them?
Webpage module property affords a facility to interact with contents inside a website.
Some module residences are:
and so on.
Question 7. What Is Webpage Module Method? Name Some Of Them?
Webpage module keeps the method for Cookies, Frames, Page Navigation, Reload, Rendering and Uploading of Files.
Some website module strategies are:
currentFrameName() and so forth.
Ext JS Tutorial Ext JS Interview Questions
Question 8. What Do You Understand About Screen Capture?
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();
Question nine. How Network Monitoring Is Done In Phantomjs?
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?
Manipulating and loading of internet pages and acting operation which includes DOM manipulation by way of clicking buttons, and so on.
Question eleven. Is Phantomjs Support Command Line Interface (cli) Execution?
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?
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?
Question 14. How Testing Are Done In Phantomjs?
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
Mocha Chutzpah, mocha-phantoms
Jasmine Chutzpah, grunt-contrib-jasmine
Question 15. What Is File System Module In Phantomjs?
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.