ENGLISH

The Protractor Handbook: Understanding and Implementing the Tool Effectively

Book information

Publisher
Apress
Year
2021
ISBN
1484272889, 9781484272886
Language
english
Format
PDF
Filesize
11 MB (11530581 bytes)
Edition
1
Pages
222\214
Time added
2021-08-29 14:12:42

Description

Learn to quickly set up Protractor and dive into the amazing possibilities that this tool offers for automating browser interactions for a user for any Angular web application. Software testing is here to stay, and an integral part of this is test automation. Protractor is one of the most evolved test automation frameworks that every software testing professional working with an Angular application should know. You will to automate a vast range of actions that a user takes to interact with the browser. From a simple ‘click’ to more complex user actions such as frame switches, selecting from drop-downs, and file downloads using Protractor APIs for Angular-based websites. You will also learn about assertions, timeouts, waits, parallel testing frameworks that are available, and the general pros and cons you should be aware of.  With over 150 working code samples demonstrating various test scenarios that you require in your day-to-day automation testing, and examples that may be given in interviews, this book will be your practical handbook to all the key Protractor API implementations. What You'll Learn Set up and install Protractor efficientlyImplement Angular-specific locator strategiesAutomate Angular web pagesRun parallel execution using ProtractorExplore all the pros, cons and challenges you may face while using ProtractorUse specific notes around each API to ensure optimum usage and avoid common mistakes Who This Book Is For Ideal for test engineers who have a basic understanding of test automation with Selenium, developers who want to implement this testing tool for internal testing, Test Managers/IT Project Managers who want to get some general understanding of this tool and its advantages, and students who want to pursue career in test automation. Table of Contents About the Author About the Technical Reviewer Acknowledgments Chapter 1: Getting Started Introduction Installation Prerequisites Installation Process Additional Information Summary Chapter 2: Selenium-Inherited Web Locators Tag Name Syntax Output IDs Syntax Output className Syntax Output Name Attribute Syntax Output Link Text Syntax Output Note Partial Link Text Syntax Output Note CSS Selector Syntax Output Note XPath Syntax Output Note JS Function Syntax Output Summary Chapter 3: Protractor Web Locators Fetching More Than One Element Syntax Output Chain Selectors Syntax Output Model Syntax Output Repeater and exactRepeater Syntax Output Binding and exactBinding Syntax Output Options Syntax Output Custom Selectors Syntax Output Summary Chapter 4: Web Page Interactions I Understanding then and async/await Debugging Notes Get an Element’s Text Syntax Output Notes Send Text to an Input Field Syntax Output Notes Click an Element Syntax Output Double-Click an Element Syntax Output Right-Click an Element Syntax Output Get the Number of Elements Present on a Web Page Output Get the First Element Returned from an Array of Elements Syntax Output Notes Get Any Element Returned from an Array of Elements Syntax Output Iterate All Elements Syntax Output Notes Summary Chapter 5: Web Page Interactions II Testing non-Angular Web Pages Syntax Output Notes Get the Processed Configuration File Syntax Output Get a Web Page Source Code File Syntax Output Get a Web Page Title and URL Syntax Output Refreshing a Web Page Syntax Output Notes Navigating to a New URL in a Browser Syntax Output Notes Navigating Back in a Browser Syntax Output Navigating Forward in a Browser Syntax Output Maximizing the Browser Syntax Output Notes Getting and Setting Window Size and Position Syntax Output Getting Element Location and Size Syntax Output Open a New Tab Syntax Output Close a New Tab Syntax Output Scroll to an Element Syntax Output Summary Chapter 6: Web Page Interactions III Uploading a File Syntax Output Notes Submitting a Form Getting the Location of an Element on a Web Page Syntax Output Handling Drop-Downs Syntax Output Dragging and Dropping Syntax Output Hovering the Mouse over an Element Syntax Output Execute Script Syntax Output Switching Between Windows Syntax Output Switching Between Frames Within a Web Page Output Alerts: Accepting an Alert Syntax Output Alerts: Dismissing an Alert Syntax Output Alerts: Sending Message to an Alert Syntax Output Getting an HTML Element’s ID Syntax Output Getting an Element’s Attribute Syntax Output Getting the Tag Name Syntax Output Getting the CSS Property Syntax Output Summary Chapter 7: Jasmine and Selenium Assertions Verifying If Strings Match by Value Output Verifying If Expected Result and Actual Results Are Same Output Verifying If the Values Are Truthy or Falsy Verifying If a String Is Present with toContain Output Negating Matchers Output Some Other Interesting Matchers Is the Element Present?: isPresent() Output Is the Element Selected?: isSelected() Syntax Output Is the Element Enabled?: isEnabled() Syntax Output Notes Is the Element Visible?: isDisplayed() Syntax Output Summary Chapter 8: Waits and Timeouts Hard and Explicit Waits at a Glance Hard Waits Syntax Output Explicit Wait: Wait for an Element to Be Displayed Syntax Output Wait for Element to Be Clickable Syntax Output Wait for Text to Be Present in an Element Value Syntax Output Wait for an Element to Exist Syntax Output Title Is/URL Is/Title Contains/URL Contains Syntax Output Implicit Wait Timeouts: Protractor Waiting for Page to Load Timeouts: WebDriver allScriptsTimeout Timeouts: Jasmine Spec Timeout Timeouts: Selenium Server Start Timeout Summary Chapter 9: Framework Options and Design Pattern Framework Introduction Protractor with TypeScript and Cucumber BDD Protractor with Jasmine Protractor with Mocha Design Pattern Introduction base.js login.page.js landing.page.js spec.js Summary Chapter 10: Configuration File Direct Connect Specs Exclude Suites Hooks Reporters Capabilities Summary Chapter 11: Conclusion The Advantages of Using Protractor The Disadvantages of Using Protractor Challenges Faced When Using Protractor Index

Similar books

Session C11: Ancient Cultural Landscapes in South Europe – their Ecological Setting and Evolution, Session C22: Gardeners from South America, Session S04: Agro-Pastoralism and Early Metallurgy Sessions, Session WS29: The Idea of Enclosure in Recent Iberian Prehistory, Session C88: Rhytmes et causalites des dynamiques de l'anthropisation en Europe entre 6500 ET 500 BC: Hypotheses socio-culturelles et/ou climatiques: Proceedings of the XV UISPP World Congress (Lisbon 4-9 September 2006) / Actes du XV Congrès Mondial (Lisbonne 4-9 Septembre 2006) Vol.36

2010 · PDF

THE BRITISH ARMY IN INDIA: ITS PRESERVATION BY AN APPROPRIATE CLOTHING, HOUSING, LOCATING, RECREATIVE EMPLOYMENT, AND HOPEFUL ENCOURAGEMENT OF THE TROOPS. with AN APPENDIX ON INDIA : THE CLIMATE OP ITS HILLS ; THE DEVELOPMENT OF ITS RESODRCBS, INDUSTRY, AND ARTS ; THE ADMINISTRATION OF JUSTICE ; THE BLACK ACT ; THE PROGRESS OF CHRISTIANITY ; THE TRAFFIC IN OPIUM ; THE VALUE OF INDIA ; PERMANENT CAUSES OF DISAFFECTION, AND OF THE RECENT REBELLION ; THE TRADITIONARY POLICY; MISGOVERNMENT BY NATIVE RULERS ; ANNEXATIONS OF THEIR TERRITORY, ETC.

1858 · PDF