JavaScript Questions & Answers – JavaScript with WebPageTest

This set of Javascript Multiple Choice Questions & Answers (MCQs) focuses on “JavaScript with WebPageTest”.

1. When does WebPageTest become necessary?
a) To run any common website
b) To run private websites
c) To run QA testing
d) To run media testing
View Answer

Answer: b
Explanation: If you want to run tests on web sites that are not publicly available—like a QA or development environment, or if you can only have your test results stored on your own servers because of legal or other reasons, then installing your own private instance of WebPagetest is the way to go.

2. What is the purpose of the Auth tab in the testing platform?
a) To specify credentials
b) To authorize a page
c) To run the test
d) To run user access
View Answer

Answer: a
Explanation: In the Auth tab you can specify credentials to use if the web site uses HTTP authentication for access.

3. What is the purpose of the Script tab?
a) To edit the coding
b) To run on multiple servers
c) To run more complex tests
d) To run media
View Answer

Answer: c
Explanation: The Script tab can be used to run more complex tests that involve multiple steps including navigate to multiple URLs, etc.
advertisement
advertisement

4. Which is the command that is used to spoof the client user agent?
a) setUserAgent
b) spoofAgent
c) spoofClientUserAgent
d) spoofUser
View Answer

Answer: a
Explanation: The setUserAgent spoofs the client user agent.

5. What is the purpose of the Block tab?
a) To block the response
b) To block the request
c) To block the mouse pointer
d) To block the cursor
View Answer

Answer: b
Explanation: The Block tab allows us to block content coming in our request.
Note: Join free Sanfoundry classes at Telegram or Youtube

6. What is the purpose of the Video tab?
a) To take video of the page
b) To capture screenshots of the test only
c) To take video of the test
d) To capture screenshots of the page
View Answer

Answer: d
Explanation: The Video tab allows you to capture screenshots of your page as it loads and views them as a video.

7. What is the task of the Advanced Panel?
a) Test stop running
b) Loading the pages
c) Skewing the results
d) Loading the server
View Answer

Answer: a
Explanation: In the Advanced panel, you can have the test stop running at document completion. That will tell us when the document.onload event is fired, instead of when all assets on the page are loaded.
advertisement

8. What is the vulnerability of XHR communications?
a) There is no vulnerability
b) Skewing the results
c) Registration and Skewing the results
d) Registering the test results
View Answer

Answer: c
Explanation: XMLHttpRequest (XHR) is an API in the form of an object whose methods transfer data between a web browser and a web server. XHR communications that may happen after page load could register as new activity and skew the test results.

9. Which of the following methods adds and connects the point to the cubic bezier curve?
a) bezierConnect()
b) bezierCurveTo()
c) Connectbezier()
d) bezierTo()
View Answer

Answer: b
Explanation: A cubic bezier curve requires three points. The first two points are control points that are used in the cubic Bézier calculation and the last point is the ending point for the curve. This method adds a new point P to the subpath and connects it to the current point with a cubic Bezier curve.
advertisement

10. Which of the following methods adds an arc to the current subpath?
a) bezierCurveTo()
b) arcTo()
c) arc()
d) Curve()
View Answer

Answer: c
Explanation: The arc() method adds an arc to the current subpath. The arc() function is fined in the canvas method.

Sanfoundry Global Education & Learning Series – Javascript Programming.

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.