The document discusses the Page Object pattern for automating web browser tests with Selenium. It describes how tests interact with web browsers by loading pages and interacting with elements. It provides an example test that searches Google for different name variations. The document notes that tests can become brittle if they rely on CSS selectors that may change, such as those based on layout. It suggests using unique identifiers for elements when possible to make tests more robust to changes.
DSL, Page Object and Selenium – a way to reliable functional testsMikalai Alimenkou
Presentation from first Selenium conference in Europe - Selenium Camp (http://seleniumcamp.com) about different test design approaches to make functional tests on Selenium more flexible, reliable and stable.
This document discusses automated testing with Selenium WebDriver and the page object pattern. It provides an overview of automated testing benefits and challenges. The document then explains Selenium, including that it automates web browsers rather than being a test framework. It introduces the page object pattern to reduce duplicated code and encapsulate page internals. Finally, it demonstrates the pattern with an example login page object and discusses Selenium support for initializing page objects.
Better Page Object Handling with Loadable Component PatternSQALab
This document discusses the Loadable Component pattern for improving page object handling in Selenium tests. It begins with an introduction to page object patterns and common failures. It then covers topics like wait strategies in Selenium, the LoadableComponent and SlowLoadableComponent patterns, and implementing these patterns on an existing project. Examples are provided in Java of how to update base page classes and page object classes to use these patterns. Common failures like brittle tests are also discussed.
These are training slides created by me to conduct training and knowledge sharing sessions for beginners in Cognizant Technology Solutions for Selenium Automation.
Mastering UI automation at Scale: Key Lessons and Best Practices (By Fernando...Applitools
Written and presented by Fernando Martin.
Automated End-to End-Testing is a two-edged sword; it can be the hero, saving you time during regression testing and preventing faulty releases, or it can be the villain, slowing down the development and release process with flaky, hard to maintain and time-consuming suites that you don't trust or want.
Test automation expert and leading software developer Fernando Martin have seen both. In this talk, he will go through key lessons he learnt, and how he applied them to open source AugmentedDriver - a tool that allowed his team to run more than 80,000 tests in a month, running suites of more than 275 tests in less than 15 minutes.
Watch this in-depth webinar, and learn how to:
Lesson 1: Achieve Throughput: UI tests are inherently slow. Learn how to focus on Parallelism to achieve throughput.
Lesson 2: Achieve Reliability: Learn how to avoid common flakiness pitfalls that make tests unreliable.
Lesson 3: Achieve Modularity and Re-usability: Learn how to architect your framework so it can be easily extended and it can quickly adapt to changes.
Lesson 4: Achieve Encapsulation of Business Logic: Learn how to effectively combine all the previous lessons to make your tests sturdy and readable.
Lesson 5: Achieve Visibility and Transparency: Reporting; consolidating each piece of your framework into something that can be easily understood and digested by the rest of your team.
Lesson 6: Integration and Easy Configuration: Provide easy configuration so the suites can be run effortless by the rest of your team and can be plugged into your CI Systems.
Automation Abstraction Layers: Page Objects and BeyondAlan Richardson
An overview of different approaches to Page Objects and Domain Objects for GUI Automation. Examples use WebDriver and Java.
Full source code is available to download, For more details see the associated blog post.
Better Page Object Handling with Loadable Component PatternSargis Sargsyan
This document discusses using the Loadable Component pattern to improve page object handling in Selenium tests. It introduces the LoadableComponent and SlowLoadableComponent classes, which are designed to make page objects less brittle by ensuring pages are fully loaded before interacting with elements. This approach reduces boilerplate code and makes tests easier to maintain. The document also covers common failures like brittle tests, not building a framework properly, and not using explicit waits, as well as tips for continuous integration of automated tests.
DSL, Page Object and Selenium – a way to reliable functional testsMikalai Alimenkou
Presentation from first Selenium conference in Europe - Selenium Camp (http://seleniumcamp.com) about different test design approaches to make functional tests on Selenium more flexible, reliable and stable.
This document discusses automated testing with Selenium WebDriver and the page object pattern. It provides an overview of automated testing benefits and challenges. The document then explains Selenium, including that it automates web browsers rather than being a test framework. It introduces the page object pattern to reduce duplicated code and encapsulate page internals. Finally, it demonstrates the pattern with an example login page object and discusses Selenium support for initializing page objects.
Better Page Object Handling with Loadable Component PatternSQALab
This document discusses the Loadable Component pattern for improving page object handling in Selenium tests. It begins with an introduction to page object patterns and common failures. It then covers topics like wait strategies in Selenium, the LoadableComponent and SlowLoadableComponent patterns, and implementing these patterns on an existing project. Examples are provided in Java of how to update base page classes and page object classes to use these patterns. Common failures like brittle tests are also discussed.
These are training slides created by me to conduct training and knowledge sharing sessions for beginners in Cognizant Technology Solutions for Selenium Automation.
Mastering UI automation at Scale: Key Lessons and Best Practices (By Fernando...Applitools
Written and presented by Fernando Martin.
Automated End-to End-Testing is a two-edged sword; it can be the hero, saving you time during regression testing and preventing faulty releases, or it can be the villain, slowing down the development and release process with flaky, hard to maintain and time-consuming suites that you don't trust or want.
Test automation expert and leading software developer Fernando Martin have seen both. In this talk, he will go through key lessons he learnt, and how he applied them to open source AugmentedDriver - a tool that allowed his team to run more than 80,000 tests in a month, running suites of more than 275 tests in less than 15 minutes.
Watch this in-depth webinar, and learn how to:
Lesson 1: Achieve Throughput: UI tests are inherently slow. Learn how to focus on Parallelism to achieve throughput.
Lesson 2: Achieve Reliability: Learn how to avoid common flakiness pitfalls that make tests unreliable.
Lesson 3: Achieve Modularity and Re-usability: Learn how to architect your framework so it can be easily extended and it can quickly adapt to changes.
Lesson 4: Achieve Encapsulation of Business Logic: Learn how to effectively combine all the previous lessons to make your tests sturdy and readable.
Lesson 5: Achieve Visibility and Transparency: Reporting; consolidating each piece of your framework into something that can be easily understood and digested by the rest of your team.
Lesson 6: Integration and Easy Configuration: Provide easy configuration so the suites can be run effortless by the rest of your team and can be plugged into your CI Systems.
Automation Abstraction Layers: Page Objects and BeyondAlan Richardson
An overview of different approaches to Page Objects and Domain Objects for GUI Automation. Examples use WebDriver and Java.
Full source code is available to download, For more details see the associated blog post.
Better Page Object Handling with Loadable Component PatternSargis Sargsyan
This document discusses using the Loadable Component pattern to improve page object handling in Selenium tests. It introduces the LoadableComponent and SlowLoadableComponent classes, which are designed to make page objects less brittle by ensuring pages are fully loaded before interacting with elements. This approach reduces boilerplate code and makes tests easier to maintain. The document also covers common failures like brittle tests, not building a framework properly, and not using explicit waits, as well as tips for continuous integration of automated tests.
DSL, Page Object and WebDriver – the path to reliable functional tests.pptxMikalai Alimenkou
Presentation from 10th SQADays conference in Moscow (December 2011) about different test design approaches to make functional tests on WebDriver more flexible, reliable and stable.
APIs: A Better Alternative to Page ObjectsSauce Labs
APIs are proposed as an alternative to page objects for reducing repetition, improving maintenance and readability in tests. APIs abstract the test code away from the page structure by making calls to functions that interact with the system under test via its API. While APIs can improve tests, they require close cooperation from developers to implement and do not completely replace page objects due to upfront costs.
Page Object Model and Implementation in Selenium Zoe Gilbert
There are various frameworks that have been used by the IT industry for robust, easy maintenance, and to automate their applications to make them flexible and reusable. Page Object Model is one of the frameworks that have been covered here in this blog step by step clearly to help you understand.
This talk was given at "Easy Automation in Python" meetup (https://www.meetup.com/Test-Fanatic-MeetUp/events/236481850/).
The talk is about some easy approaches in building web ui automation in python.
As an "easy tool" the selene library is uses.
src code for the talk: https://github.com/yashaka/talks/tree/master/easy-automation-py
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...seleniumconf
Dan Cuellar discusses strategies for writing automated tests that are robust and maintainable in the face changing codebases and features. These include separating logical test actions from direct controller calls, centralizing site elements and logic, adding self-testing capabilities, consolidating product actions into abstracted libraries, and creating platform-agnostic test scripts. The goal is to design tests that can adapt easily without extensive rework when underlying systems evolve rapidly.
Self-Generating Test Artifacts for Selenium/WebDriverseleniumconf
The document discusses issues with maintaining automated tests when a website undergoes frequent changes. It proposes generating page object models on every build to account for changes as they happen. This avoids failures from id, type, or navigation path changes. Developers must fix type changes before check-in. With regeneration, tests absorb insignificant changes and the test pass rate improves from identifying issues within 24 hours without noise. The approach provides a model to generate additional tests around standards, errors, forms and security. While reported defects did not decrease, the solution allowed increased velocity and faster feature addition.
The document discusses Selenium and how it can be used for test automation in .NET. Selenium is mostly used as a test automation tool and can automate browsers. It works in .NET through Selenium WebDriver. The document provides guidance on writing initial tests using a heuristic approach, then refactoring the tests to add structure and best practices around mapping test cases, code style, and test architecture including using the page object pattern. This improves test maintainability, scalability, and allows modeling the application under test.
This document discusses different types of software testing including unit tests, integration tests, and end-to-end tests. It emphasizes that code should be designed with loosely coupled and independently testable units, and each unit should be tested separately before testing how units interact. It also provides information on testing tools and frameworks like Jasmine and strategies like test-driven development.
Slides for the presentation I did for the Vancouver AngularJS meetup group.
http://www.meetup.com/vanangularJS/events/216391652/
The code is available on my github account.
https://github.com/aeisenberg/angular-app/tree/vanangular-protractor
(Notice the branch is not master.)
Statistical Element Locator by Oren Rubin - SeleniumConf UK 2016Oren Rubin
In this talk we will delve into one the biggest challenges that Test Automation developers face, finding elements i.e. a robust test means finding the same element with high fidelity while the Application Under Test keeps changing.
We will categorise the methods, and show where developer fail, where machines (Record/Playback) fail, and suggest a new way for locating elements, and analyze the skill-set required to overcome those difficulties.
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...Alan Richardson
This document provides an overview of a half-day tutorial on building abstraction layers for web automation tests using Selenium WebDriver. The tutorial will cover common approaches to modeling web applications and constructing page object and other abstraction layers. Attendees will participate in exercises to experiment with different abstraction techniques using a sample todo list application. The session will discuss topics like page object design, element abstractions, domain objects, and component abstractions. Code examples demonstrating various abstraction implementations will also be presented and analyzed.
Main instruments used for Web UI test automation.
Drivers: Selenium WebDriver, Sikuli X.
Frameworks: PageFactory, TestNG.
Other tools: Apache Ant, Jenkins CI.
Test automation & Seleniun by oren rubinOren Rubin
The document discusses test automation and Selenium. It begins by explaining the differences between unit tests and end-to-end tests, then introduces Selenium as a tool for writing end-to-end tests across different browsers. It covers Selenium best practices like page object modeling and using Selenium Grid for parallel testing across browsers and devices. It also discusses techniques like visual validation using Applitools and recording and playback of tests.
Slides cover how to get started testing your web application. Technologies and concepts explained:
- Unit tests (mocha, jasmine, karma)
- System tests (Selenium)
- Code coverage (istanbul)
- CI servers
Automated UI Testing Done Right (QMSDNUG)Mehdi Khalili
This document discusses best practices for automated UI testing. It recommends using page object models to organize tests and break pages into smaller page components. Tests should be strongly typed using view models for pages. Following principles like DRY, SRP and YAGNI can help avoid duplication and keep tests maintainable. Tests should run frequently to catch breaks early. Overall, UI testing is challenging but doing it right by applying these practices can help maximize value and avoid wasted effort.
An Introduction to AngularJS End to End Testing using ProtractorCubet Techno Labs
This document summarizes a presentation about end-to-end testing of AngularJS applications using Protractor. It introduces Protractor as an AngularJS testing framework that uses WebDriver and Jasmine to test applications. It describes how Protractor works by controlling browsers through WebDriver and using the Jasmine syntax for writing tests. The document then outlines how to install, configure, and write tests with Protractor including locating elements and interacting with them.
The document provides an overview of getting started with Selenium and outlines 8 steps to write automated tests:
1. Define a test strategy by determining what to test and which browsers to support
2. Choose a programming language like Java and set up dependencies
3. Learn Selenium fundamentals like locating elements and common actions
4. Write a first test to log in to a sample site
5. Create page objects and a base page to make tests reusable and maintainable
6. Add waits to make tests more resilient when waiting for elements
7. Set up a test harness for centralized setup/teardown, reporting and parallelization
8. Add cross-browser testing by using browser drivers locally or remotely
The document discusses the history and evolution of Selenium and some of its key features. It describes how Selenium started as a solution to automate testing for a Python application and help address problems with browser compatibility. Over time, Selenium grew in popularity and was expanded through additions like the Selenium IDE, support for different browsers, and the ability to extend its functionality through user-defined scripts and customizations. The document emphasizes that true value comes from effectively implementing automation solutions and shares some strategies like using page object models, integrating with CI tools, and taking advantage of newer Selenium capabilities like WebDriver.
Top100summit 谷歌-scott-improve your automated web application testingdrewz lin
This document discusses improving automated web application testing. It begins with an introduction and agenda. Some key points:
- Testing at Google expects test code quality to match production code quality. Tests must be maintainable and meet engineering standards.
- The present focuses on Selenium/WebDriver automation best practices and things to avoid. Base classes and locator organization can help improve test robustness and maintainability.
- The future may include more exploratory testing tools like WebTestingExplorer for automated exploratory testing.
Overall the document provides guidance on using Selenium/WebDriver for web application testing in a best practices way, focusing on test code quality, maintainability, and anticipating future changes. It emphasizes organizing tests through
This document discusses PHPUnit and WebDriver for testing PHP applications. It provides an overview of test-driven development (TDD) and unit testing with PHPUnit. PHPUnit is a testing framework for unit and integration testing with features like code coverage reports. WebDriver is for acceptance and UI testing of web applications. The document also outlines PHPUnit terminology like stubs, mocks, and spies. It provides examples of PHPUnit test case structure and best practices for testing. Finally, it describes how to install PHPUnit and dependencies like SQLite for database testing.
Automation testing can be performed using Selenium WebDriver which provides advantages like frequent regression testing, rapid feedback to developers, and finding defects missed by manual testing. Selenium has evolved over time, initially starting as a project called WebDriver at Google to solve Selenium's pain points. It now supports various browsers and locators can be used to identify elements on the page for automation.
DSL, Page Object and WebDriver – the path to reliable functional tests.pptxMikalai Alimenkou
Presentation from 10th SQADays conference in Moscow (December 2011) about different test design approaches to make functional tests on WebDriver more flexible, reliable and stable.
APIs: A Better Alternative to Page ObjectsSauce Labs
APIs are proposed as an alternative to page objects for reducing repetition, improving maintenance and readability in tests. APIs abstract the test code away from the page structure by making calls to functions that interact with the system under test via its API. While APIs can improve tests, they require close cooperation from developers to implement and do not completely replace page objects due to upfront costs.
Page Object Model and Implementation in Selenium Zoe Gilbert
There are various frameworks that have been used by the IT industry for robust, easy maintenance, and to automate their applications to make them flexible and reusable. Page Object Model is one of the frameworks that have been covered here in this blog step by step clearly to help you understand.
This talk was given at "Easy Automation in Python" meetup (https://www.meetup.com/Test-Fanatic-MeetUp/events/236481850/).
The talk is about some easy approaches in building web ui automation in python.
As an "easy tool" the selene library is uses.
src code for the talk: https://github.com/yashaka/talks/tree/master/easy-automation-py
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...seleniumconf
Dan Cuellar discusses strategies for writing automated tests that are robust and maintainable in the face changing codebases and features. These include separating logical test actions from direct controller calls, centralizing site elements and logic, adding self-testing capabilities, consolidating product actions into abstracted libraries, and creating platform-agnostic test scripts. The goal is to design tests that can adapt easily without extensive rework when underlying systems evolve rapidly.
Self-Generating Test Artifacts for Selenium/WebDriverseleniumconf
The document discusses issues with maintaining automated tests when a website undergoes frequent changes. It proposes generating page object models on every build to account for changes as they happen. This avoids failures from id, type, or navigation path changes. Developers must fix type changes before check-in. With regeneration, tests absorb insignificant changes and the test pass rate improves from identifying issues within 24 hours without noise. The approach provides a model to generate additional tests around standards, errors, forms and security. While reported defects did not decrease, the solution allowed increased velocity and faster feature addition.
The document discusses Selenium and how it can be used for test automation in .NET. Selenium is mostly used as a test automation tool and can automate browsers. It works in .NET through Selenium WebDriver. The document provides guidance on writing initial tests using a heuristic approach, then refactoring the tests to add structure and best practices around mapping test cases, code style, and test architecture including using the page object pattern. This improves test maintainability, scalability, and allows modeling the application under test.
This document discusses different types of software testing including unit tests, integration tests, and end-to-end tests. It emphasizes that code should be designed with loosely coupled and independently testable units, and each unit should be tested separately before testing how units interact. It also provides information on testing tools and frameworks like Jasmine and strategies like test-driven development.
Slides for the presentation I did for the Vancouver AngularJS meetup group.
http://www.meetup.com/vanangularJS/events/216391652/
The code is available on my github account.
https://github.com/aeisenberg/angular-app/tree/vanangular-protractor
(Notice the branch is not master.)
Statistical Element Locator by Oren Rubin - SeleniumConf UK 2016Oren Rubin
In this talk we will delve into one the biggest challenges that Test Automation developers face, finding elements i.e. a robust test means finding the same element with high fidelity while the Application Under Test keeps changing.
We will categorise the methods, and show where developer fail, where machines (Record/Playback) fail, and suggest a new way for locating elements, and analyze the skill-set required to overcome those difficulties.
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...Alan Richardson
This document provides an overview of a half-day tutorial on building abstraction layers for web automation tests using Selenium WebDriver. The tutorial will cover common approaches to modeling web applications and constructing page object and other abstraction layers. Attendees will participate in exercises to experiment with different abstraction techniques using a sample todo list application. The session will discuss topics like page object design, element abstractions, domain objects, and component abstractions. Code examples demonstrating various abstraction implementations will also be presented and analyzed.
Main instruments used for Web UI test automation.
Drivers: Selenium WebDriver, Sikuli X.
Frameworks: PageFactory, TestNG.
Other tools: Apache Ant, Jenkins CI.
Test automation & Seleniun by oren rubinOren Rubin
The document discusses test automation and Selenium. It begins by explaining the differences between unit tests and end-to-end tests, then introduces Selenium as a tool for writing end-to-end tests across different browsers. It covers Selenium best practices like page object modeling and using Selenium Grid for parallel testing across browsers and devices. It also discusses techniques like visual validation using Applitools and recording and playback of tests.
Slides cover how to get started testing your web application. Technologies and concepts explained:
- Unit tests (mocha, jasmine, karma)
- System tests (Selenium)
- Code coverage (istanbul)
- CI servers
Automated UI Testing Done Right (QMSDNUG)Mehdi Khalili
This document discusses best practices for automated UI testing. It recommends using page object models to organize tests and break pages into smaller page components. Tests should be strongly typed using view models for pages. Following principles like DRY, SRP and YAGNI can help avoid duplication and keep tests maintainable. Tests should run frequently to catch breaks early. Overall, UI testing is challenging but doing it right by applying these practices can help maximize value and avoid wasted effort.
An Introduction to AngularJS End to End Testing using ProtractorCubet Techno Labs
This document summarizes a presentation about end-to-end testing of AngularJS applications using Protractor. It introduces Protractor as an AngularJS testing framework that uses WebDriver and Jasmine to test applications. It describes how Protractor works by controlling browsers through WebDriver and using the Jasmine syntax for writing tests. The document then outlines how to install, configure, and write tests with Protractor including locating elements and interacting with them.
The document provides an overview of getting started with Selenium and outlines 8 steps to write automated tests:
1. Define a test strategy by determining what to test and which browsers to support
2. Choose a programming language like Java and set up dependencies
3. Learn Selenium fundamentals like locating elements and common actions
4. Write a first test to log in to a sample site
5. Create page objects and a base page to make tests reusable and maintainable
6. Add waits to make tests more resilient when waiting for elements
7. Set up a test harness for centralized setup/teardown, reporting and parallelization
8. Add cross-browser testing by using browser drivers locally or remotely
The document discusses the history and evolution of Selenium and some of its key features. It describes how Selenium started as a solution to automate testing for a Python application and help address problems with browser compatibility. Over time, Selenium grew in popularity and was expanded through additions like the Selenium IDE, support for different browsers, and the ability to extend its functionality through user-defined scripts and customizations. The document emphasizes that true value comes from effectively implementing automation solutions and shares some strategies like using page object models, integrating with CI tools, and taking advantage of newer Selenium capabilities like WebDriver.
Top100summit 谷歌-scott-improve your automated web application testingdrewz lin
This document discusses improving automated web application testing. It begins with an introduction and agenda. Some key points:
- Testing at Google expects test code quality to match production code quality. Tests must be maintainable and meet engineering standards.
- The present focuses on Selenium/WebDriver automation best practices and things to avoid. Base classes and locator organization can help improve test robustness and maintainability.
- The future may include more exploratory testing tools like WebTestingExplorer for automated exploratory testing.
Overall the document provides guidance on using Selenium/WebDriver for web application testing in a best practices way, focusing on test code quality, maintainability, and anticipating future changes. It emphasizes organizing tests through
This document discusses PHPUnit and WebDriver for testing PHP applications. It provides an overview of test-driven development (TDD) and unit testing with PHPUnit. PHPUnit is a testing framework for unit and integration testing with features like code coverage reports. WebDriver is for acceptance and UI testing of web applications. The document also outlines PHPUnit terminology like stubs, mocks, and spies. It provides examples of PHPUnit test case structure and best practices for testing. Finally, it describes how to install PHPUnit and dependencies like SQLite for database testing.
Automation testing can be performed using Selenium WebDriver which provides advantages like frequent regression testing, rapid feedback to developers, and finding defects missed by manual testing. Selenium has evolved over time, initially starting as a project called WebDriver at Google to solve Selenium's pain points. It now supports various browsers and locators can be used to identify elements on the page for automation.
This document discusses the perils of using the page object pattern for test automation frameworks. It describes the page object pattern, how it can be used to model pages in code and reduce duplication. However, it also notes limitations like tests becoming too implementation focused rather than intent focused. It then introduces a business layer page object pattern that aims to address these limitations by validating business requirements and separating concerns with abstraction layers. This allows the test pyramid to remain balanced and makes maintenance and scaling easier.
Creating automated functional tests of your web application with Selenium IDE is quick and easy, but leads to massive duplication in your test scripts. See why this duplication is a problem, and how to address it using a simple design pattern called the Page Object.
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...Atirek Gupta
A workshop on understanding how Selenium, Selenium/RC, Webdriver and browser works. Learning what is same origin policy with example. Hands on locating element using CSS and Xpath. Interacting with html with java script Finally developing a page object framework using java, webdriver from scratch.
This document discusses designing an effective test automation strategy. It notes that current testing processes often lack sufficient test coverage and ROI turns negative. It emphasizes defining the proper scope and selecting an automation solution that can cover that scope. The document then introduces iLeap 2.0, an automation platform from Impetus Technologies that integrates open-source frameworks and tools to automate functional, API/web service, and security testing according to best practices. iLeap 2.0 is said to improve test coverage and maximize ROI.
The document provides guidelines for designing a robust test automation framework. It discusses that a well-designed framework increases testing efficiency and reduces costs. The key aspects of framework design include defining objectives, selecting the appropriate framework type, managing data, ensuring reusability, integrating with other tools, and flexible execution and reporting. Idexcel's test automation framework was created following these best practices to provide a maintainable and reusable framework.
Selenium is a software testing framework for automating tests of Web applications. Join Frank Cohen for a Workshop to learn the basics of Selenium. A screencast for this presentation is on the PushToTest.com Web site.
Selenium is an open source browser automation tool used for automating web application testing. It supports recording and playback of test cases in multiple programming languages like Java, Python and Ruby. Selenium has several components like Selenium IDE for recording and playing back tests without coding, Selenium RC for running tests on remote machines, and Selenium Webdriver which allows directly controlling browser behavior without relying on external servers. Selenium Grid enables parallel execution of tests on different machines for faster test runs. Selenium is used by many companies for testing web applications and is useful for both functional and regression testing of websites and web apps.
Agile breakfast St. Gallen - Mindset. Skillset. ToolsetMichael Palotas
Michael Palotas presented at the Agile Breakfast in St. Gallen on keys to agile testing and test automation. He discussed the need for the right mindset, skillset, and toolset for testing in agile environments. This includes having a focus on rapid testing with quick feedback, test automation to save time and allow more smart testing, and treating automation as software development.
This document summarizes an advanced Selenium workshop covering topics like using Selenium in different languages, data-enabling Selenium scripts, testing Ajax applications, writing test object libraries, performance issues testing Ajax apps with Selenium and IE7, and best practices for component-based testing. The agenda includes sessions on Selenium basics, locators, XPath, event handling, TinyMCE integration, distributed testing, and performance mitigation strategies.
The document provides an introduction to the Integral test automation framework. It describes the main components of the framework including description objects, component scripts, function libraries, driver scripts, and master scripts. Description objects are used to identify objects in the application under test. Component scripts contain reusable actions for manipulating or validating individual objects. Function libraries contain reusable code. Driver scripts execute component actions in order to simulate user experiences on a screen. Master scripts control the execution of driver scripts to simulate end-to-end test scenarios.
Why one should do automation, what points to be taken into consideration while doing automation, Types of framework, Select the framework as per your project needs.
Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...Sargis Sargsyan
One of the painful problems in Selenium automated testing is determining whether a HTML page has been loaded. This is especially the case when web application uses a JS heavy framework such as the popular AngularJS.
How to handle Selenium Page Object pattern better with Loadable Component.
The Loadable Component helps test case developers make sure that the page or a component of the page is loaded successfully. I will share my experience about the concept of the Loadable Component and Page Object patterns.
This document provides an overview of Selenium, an open source tool for automating web application testing. It discusses what Selenium is, how to get it, how to use the Selenium IDE plugin to record and play back test cases in Firefox, and how to create a test suite that runs multiple test cases.
This document discusses Selenium, a tool for automating web application testing. It describes Selenium's architecture and components. The Mocha test framework is introduced for creating tests using Selenium's WebDriver API. Commands like get(), findElement(), sendKeys() and click() are demonstrated. Steps for setting up a Selenium project using JavaScript with Mocha and Chai are provided. An example test case logs into a demo application and asserts the logout link is displayed.
Rajendra Narayan Mahapatra from Mindfire Solutions presented on Selenium automation frameworks. The presentation covered definitions of an automation framework, reasons for using one, and types including modular, data-driven, and hybrid frameworks. Code was provided for fetching test data from an Excel sheet in a data-driven framework. The agenda indicated frameworks would be defined and compared.
Selenium interview questions and answerskavinilavuG
This document contains 37 questions and answers related to Selenium interview questions. Some key topics covered include commonly used annotations in TestNG, reading and writing data to Excel files using Selenium, locating elements using different locator strategies like XPath, handling alerts and popups, performing actions like drag-and-drop, uploading files, and synchronizing tests. It also discusses frameworks, prerequisites for running Selenium tests, advantages of the Selenium WebDriver, and using Selenium Grid for distributed testing.
This document discusses Behavior Driven Development (BDD) using Selenium RC. It introduces BDD and how it can improve the testing process by making tests more clear and involving different roles. It describes how to migrate an existing framework to a BDD structure using keywords to map tests to code. Challenges of this process include managing duplicate keywords and elements, exchanging data between steps, and generating random test data. Standards, reviews and training are recommended to address these challenges.
Improving Your Selenium WebDriver Tests - Belgium testing days_2016Roy de Kleijn
The document discusses improving Selenium WebDriver tests. It identifies common issues like synchronization problems and flaky tests. It recommends implementing the Page Object Model to organize test code and using data objects. It also suggests techniques like implicit waits and custom waits to handle synchronization, running tests in parallel using Docker Selenium, and using attribute selectors instead of fragile XPath locators. The document concludes with lessons on avoiding Thread.sleep(), mocking interfaces, and setting up clean test environments.
This document discusses automated acceptance testing for ASP.NET applications. It begins with a demonstration of using Selenium WebDriver to automate a Google search. The document then covers topics like the testing pipeline, challenges with real-world testing, focusing tests on solving specific pain points, and designing UI for testability. It emphasizes that UI tests should validate scenarios rather than individual actions and should focus on the most critical tests. The document also discusses tools, techniques, and strategies for testing databases, legacy systems, and more.
This document provides an introduction and overview of Selenium WebDriver. It discusses what WebDriver is, the programming languages it supports, and how it compares to the previous Selenium RC tool. It also provides step-by-step instructions on how to install WebDriver and create a simple test script in Java using the Eclipse IDE. Finally, it covers how to access forms, links, tables, perform keyboard/mouse actions, and upload files using WebDriver.
This document discusses integration testing frameworks like Cucumber, Webrat, and Capybara as well as Selenium. It describes how to build page object models in Selenium to help with test organization, readability, and reuse. Locators, waiting rules, and custom RSpec matchers are also covered. The benefits of test-driven development like better code design, focus, documentation, and avoiding test debt are highlighted.
Efficient Rails Test-Driven Development - Week 6Marakana Inc.
Learn how to apply the test-first approach to all of your Rails projects. In this six class series, experienced Rails engineer and consultant, Wolfram Arnold applies his real-world perspective to teaching you effective patterns for testing.
In this sixth of six classes, Wolf discusses:
- Integration frameworks (Cucumber, Webrat, Capybara, and Selenium)
- Integration testing with Selenium (advantages and problems)
- Page Objects
- Locators (Selenium, CSS and XPath locators
- RSpec Custom Matchers
- Testing for Access Control
** You can get the slides and source code from this presentation at: http://marakana.com/f/215 **
Find more videos, tutorials, and code examples at http://marakana.com/techtv
2007 Max Presentation - Creating Custom Flex Componentsmichael.labriola
The document discusses how to build custom Flex components. It explains the component lifecycle methods like constructor, createChildren, measure, updateDisplayList and commitProperties. It then reviews the Carousel component as an example, describing how it uses these lifecycle methods and other techniques like animation to implement its circular scrolling functionality. Questions from the audience are invited at the end.
This document discusses testing AngularJS applications. It introduces popular testing frameworks like Jasmine and Karma that can be used to write unit tests and automate testing. Jasmine is typically used for testing AngularJS code and examples are given of writing tests with Jasmine. Karma is presented as a tool to automate testing by running tests in browsers. Protractor is introduced for end-to-end testing of front-end DOM elements. The document argues that front-end testing will become more important and integrated into development as tools continue to improve.
This document summarizes a presentation on jQuery from the ground up. It introduces jQuery as a JavaScript library for document traversal, event handling, animations and AJAX. It discusses how to get jQuery, set it up, use basic selectors and the ready method. It also provides an overview of jQuery UI and plugins, and invites questions.
Last year, AOL adopted a new content strategy and has positioned itself as a premier destination for original content. Core to this strategy is having reusable, highly efficient and optimized common code and experiences at scale, which is where jQuery comes in. Check in with Dave Artz to see how jQuery has helped his front-end standards team tackle unique challenges like optimizing 3rd party widget performance, overriding plugin functionality, and managing dependencies and updates across 100+ sites spanning multiple back-end platforms.
The document provides an overview of model layer development in Coldbox, including creating model CFCs, using Wirebox for dependency injection, and unit testing models with MXUnit. Key points covered include:
- Using a service layer approach and creating a "recommendationService" and "recommendationGateway"
- Leveraging Wirebox to inject dependencies into CFCs
- Unit testing model CFCs with MXUnit to validate functionality and catch errors
- Demonstrating the creation of a basic "recommendationGateway" CFC with CRUD methods and associated MXUnit tests to validate behavior
Javascript unit testing, yes we can e bigAndy Peterson
This document discusses test-driven development for JavaScript using ScrewUnit and BlueRidge. It introduces the Carbon Five consulting firm and covers why JavaScript unit testing is important. It then demonstrates how to write behavioral tests using ScrewUnit's BDD style and shows a live example testing a wizard component. Some challenges of JavaScript testing like DOM cleanup and structure are addressed. The document emphasizes that JavaScript testing is possible and can be integrated into the development process.
SearchLove Boston 2013_Will Critchlow_Technical SEODistilled
The document provides technical recommendations for SEO, including:
1. Removing URL parameters, implementing rel="alternate" for mobile sites, and using HREFLANG tags to group international sites. It also recommends diagnosing actual site speed issues, implementing Twitter Cards, and getting familiar with JavaScript, jQuery, and debugging tools.
2. Auditing AJAX implementations to ensure all content and links are crawlable without JavaScript. It notes Google can now index some JavaScript-rendered content like Facebook comments.
3. When making recommendations, being prescriptive, but when auditing, being cautious of the costs of changes if content is already being indexed. Fix only what's necessary, not purely for technical purity.
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)Ondřej Machulda
Annotated slides from Berlin PHP Usergroup Meetup, 4th April 2017.
---
Not only unit tests but also end-to-end tests in real browser are important part of test automation and test pyramid. So let's have a look how to easily write and run Selenium functional tests using PHPUnit and Steward.
This document discusses testing web applications using Selenium. It begins by describing the unique aspects of web application testing, including that web apps have heterogeneous systems with dynamic frontends and backends. It then covers how Selenium can be used to automate testing by simulating user interactions in the browser. Specifically, it details the Selenium IDE Firefox extension for recording and replaying tests, and Selenium WebDriver for programmatically controlling the browser with various languages. The document provides examples of using WebDriver to locate elements, enter values, submit forms, and verify results. It concludes by outlining a course project to test the "Add New Class" functionality of a web app without access to the source code.
Access tips access and sql part 4 building select queries on-the-flyquest2900
This document discusses building select queries dynamically in Microsoft Access using VBA and SQL. It describes creating a stored query, building a dialog box to collect user criteria, and writing code to generate a SQL statement based on the user's selections. The code declares variables, builds the SQL by concatenating strings representing the criteria values, and tests the generated SQL by printing it to the Immediate window or displaying in a message box. The goal is to create a flexible multi-purpose query tool allowing users to filter data without knowledge of Access or SQL.
Similar to Selenium - The page object pattern (20)
The document discusses responsive web design layout testing using the Galen Framework with Selenium. It provides an overview of responsive web design, the Galen Framework which allows defining element relationships and expected layouts in a specification language to test responsiveness across viewports and platforms. It also discusses how idealo uses agile development practices and a testing stack including Selenium, JUnit, Maven and Jenkins to integrate layout testing into their build and deployment process using Galen. The document concludes with noting some lessons learned from using Galen at idealo.
Berlin Selenium Meetup - A quick introduction to SeleniumMichael Palotas
This document provides an introduction to Selenium. It discusses that Selenium was named as an alternative to Mercury testing software to help cure issues with other tools. Selenium automates browsers and is becoming a W3C standard. It supports various browsers and programming languages but is not meant for performance or report generation. The document also briefly outlines Selenium Grid for scaling tests across environments and that Selenium is open source.
Zürich selenium meetup mobile and web automation under one umbrellaMichael Palotas
Michael Palotas gave a presentation on web and mobile automation using Selenium. He discussed how Selenium and related tools like Selenium Grid, Selenium WebDriver, Selendroid, and iOS-Driver allow for automating tests across web and mobile platforms under one framework. He emphasized asking the right questions about reuse, supported platforms, and scaling before starting an automation project. Palotas also covered open source benefits and provided examples of simple mobile and web tests.
Mobile Test Automation using one API and one infrastructureMichael Palotas
This document discusses mobile test automation using Selenium, Selendroid, and iOS-Driver. It provides an overview of these tools, including how they implement the Selenium WebDriver protocol to test mobile web and native applications on Android and iOS devices. The document also covers building a cross-platform test infrastructure using these tools along with Selenium Grid for parallel testing across environments.
The document discusses agile testing and bug prevention. It advocates for embedding testers within development teams to focus on prevention rather than detection of bugs. The ideal approach involves continuous testing parallel to development with the entire team involved in testing.
Testing in the new world-bug prevention vs. bug detectionMichael Palotas
This document discusses testing approaches in agile development. It notes that with agile development using 2 week cycles, there is a shift from bug detection to bug prevention. It outlines the roles of testers and developers in agile teams, with testers focusing on manual testing and rapid feedback while developers rely more on test-driven development and automation. An example is given of how Atlassian uses both developers and testers by having testers focus on domain knowledge and manual testing of primary artifacts while developers concentrate on test automation and infrastructure. The key to their approach is emphasized as test automation within a continuous integration pipeline.
Mobile test automation with Selenium, Selendroid and ios-driverMichael Palotas
Michael Palotas presented on mobile test automation. He discussed Selenium and tools like Selendroid and iOS-Driver for automating mobile apps. Palotas emphasized that automation is software development and developers should consider questions around supported platforms, test infrastructure integration, and scaling strategies. He demonstrated mobile test automation and advocated for an open source approach.
German Testing Day Keynote - Testing at ebay - a look at a rather unconvent...Michael Palotas
This document summarizes Michael Palotas' presentation on testing at eBay. It discusses eBay's history and growth, introducing agile development practices. It emphasizes the importance of test automation, preventing bugs, and productivity/efficiency. It outlines eBay's approach to horizontal and vertical testing support. It also discusses test management, metrics, open source tools, and goals of reducing bugs while improving user experience.
The document discusses Selendroid, a tool for automating tests on mobile web and native Android applications. It begins with an overview of Selenium and the need for mobile test automation. Selendroid is introduced as an open source tool that allows controlling Android devices and applications using the WebDriver protocol. It supports testing native and hybrid mobile applications as well as mobile web. Key features highlighted include compatibility with the JSON wire protocol, no app modification requirement, and support for gestures, grid infrastructure and an inspector tool.
This document discusses skillset, toolset, and mindset for successful agile test automation. It provides an overview of eBay as a large company with many employees and transactions. It then discusses the importance of test automation using Selenium and Selenium Grid to save time and provide early feedback. The ideal skillset for testers is also discussed, emphasizing the need for testers even with increased automation.
This document provides an overview of eBay from the perspective of Michael Palotas, Head of Quality Engineering Europe. It discusses eBay's current challenges around scaling, mobile, and cross-border trade. It also describes how eBay builds and tests software through a global network and how it approaches testing, with a focus on test automation and challenges in testing mobile apps across different devices and languages.
Selenium is an open source tool for automating web browsers across many platforms and browsers. It was named Selenium as a cure for Mercury Interactive testing software, similar to how selenium supplements cure mercury poisoning. The document discusses how eBay uses Selenium for automated testing, including building a grid for parallel testing on virtual machines, implementing page object models, and extending Selenium to test mobile web and native apps through projects like Calabash and iOS driver. It also notes the benefits of open source testing tools and how eBay contributes solutions back to the Selenium community.
This document summarizes eBay's approach to mobile testing and test automation. It discusses the challenges of testing across different mobile devices and localizations. It outlines requirements for mobile test automation, including parallel execution and support for multiple apps, languages, and devices. It then describes eBay's test automation of the mobile web using Selenium, and their custom open source projects for automating tests of Android and iOS native apps at scale. These projects integrate mobile testing tools like Calabash and UI Automation into the Selenium grid for a consistent test automation approach across platforms.
This document summarizes eBay's approach to testing. It discusses how eBay has transitioned from manual to automated testing using Selenium and how it has customized the Selenium Grid for its own needs by developing plugins. Some key points are that eBay automated 3,500 tests using Selenium Grid, developed plugins to integrate virtual machines and enable remote viewing of tests, and is exploring using Selenium for mobile and native application testing.
This document discusses how eBay tests its products and services. It notes that testing is done globally by over 300 test engineers across multiple sites. While manual testing remains important, especially for new features, eBay has invested heavily in automation to help test over 3500 test cases across its European sites in under an hour. This large-scale automation was made possible through the use of a testing grid with over 150 virtual machines and browsers. The document shows that increased automation efforts have correlated with reduced bug rates and higher quality bugs found by the EU testing team.
This document outlines 10 lessons learned about test automation from eBay. It provides facts about eBay, including that it has 27770 employees worldwide and processes 2 billion page views and 75 billion database calls daily. The lessons recommend flipping the testing triangle to focus more on automation, ensuring everyone knows what is automated, using test aspects to guide automation, and treating automation as software development. It emphasizes the importance of maintainability, using the same language as developers, investing in test infrastructure, and that manual testing remains important alongside automation.
Implementing Test Automation in Agile ProjectsMichael Palotas
This document discusses test automation practices at eBay. It begins by providing facts about eBay as a company and platform. It then outlines eBay's approach to test automation, which involves designing automated tests using test aspects, modeling the business domain layer, and implementing tests using Selenium. The document advocates for a lean approach to test automation to avoid technical debt and waste. It emphasizes automating regression tests first before expanding to other test types and executing tests in parallel using a Selenium Grid for faster feedback.
Test Automation and Innovation with Open Source ToolsMichael Palotas
This document discusses test automation at eBay using open source tools. It provides facts about eBay as a company and platform. The key points are:
1. eBay uses test automation with Selenium and open source tools to get early feedback from regression tests and reinvest time saved into more manual testing.
2. Their automation history started with homegrown solutions and moved to Selenium IDE, RC and now Selenium 2 along with a Selenium Grid for parallel testing across environments.
3. Using open source allows for faster innovation, independence, engagement with the community, and easier hiring. The potential risks include lack of support and competitors using the same tools.
4. Their test automation framework uses page objects, flow objects and a
SMS API Integration in Saudi Arabia| Best SMS API ServiceYara Milbes
Discover the benefits and implementation of SMS API integration in the UAE and Middle East. This comprehensive guide covers the importance of SMS messaging APIs, the advantages of bulk SMS APIs, and real-world case studies. Learn how CEQUENS, a leader in communication solutions, can help your business enhance customer engagement and streamline operations with innovative CPaaS, reliable SMS APIs, and omnichannel solutions, including WhatsApp Business. Perfect for businesses seeking to optimize their communication strategies in the digital age.
UI5con 2024 - Bring Your Own Design SystemPeter Muessig
How do you combine the OpenUI5/SAPUI5 programming model with a design system that makes its controls available as Web Components? Since OpenUI5/SAPUI5 1.120, the framework supports the integration of any Web Components. This makes it possible, for example, to natively embed own Web Components of your design system which are created with Stencil. The integration embeds the Web Components in a way that they can be used naturally in XMLViews, like with standard UI5 controls, and can be bound with data binding. Learn how you can also make use of the Web Components base class in OpenUI5/SAPUI5 to also integrate your Web Components and get inspired by the solution to generate a custom UI5 library providing the Web Components control wrappers for the native ones.
SOCRadar's Aviation Industry Q1 Incident Report is out now!
The aviation industry has always been a prime target for cybercriminals due to its critical infrastructure and high stakes. In the first quarter of 2024, the sector faced an alarming surge in cybersecurity threats, revealing its vulnerabilities and the relentless sophistication of cyber attackers.
SOCRadar’s Aviation Industry, Quarterly Incident Report, provides an in-depth analysis of these threats, detected and examined through our extensive monitoring of hacker forums, Telegram channels, and dark web platforms.
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesQuickdice ERP
Explore the seamless transition to e-invoicing with this comprehensive guide tailored for Saudi Arabian businesses. Navigate the process effortlessly with step-by-step instructions designed to streamline implementation and enhance efficiency.
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...XfilesPro
Wondering how X-Sign gained popularity in a quick time span? This eSign functionality of XfilesPro DocuPrime has many advancements to offer for Salesforce users. Explore them now!
Unveiling the Advantages of Agile Software Development.pdfbrainerhub1
Learn about Agile Software Development's advantages. Simplify your workflow to spur quicker innovation. Jump right in! We have also discussed the advantages.
Microservice Teams - How the cloud changes the way we workSven Peters
A lot of technical challenges and complexity come with building a cloud-native and distributed architecture. The way we develop backend software has fundamentally changed in the last ten years. Managing a microservices architecture demands a lot of us to ensure observability and operational resiliency. But did you also change the way you run your development teams?
Sven will talk about Atlassian’s journey from a monolith to a multi-tenanted architecture and how it affected the way the engineering teams work. You will learn how we shifted to service ownership, moved to more autonomous teams (and its challenges), and established platform and enablement teams.
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfVALiNTRY360
Salesforce Healthcare CRM, implemented by VALiNTRY360, revolutionizes patient management by enhancing patient engagement, streamlining administrative processes, and improving care coordination. Its advanced analytics, robust security, and seamless integration with telehealth services ensure that healthcare providers can deliver personalized, efficient, and secure patient care. By automating routine tasks and providing actionable insights, Salesforce Healthcare CRM enables healthcare providers to focus on delivering high-quality care, leading to better patient outcomes and higher satisfaction. VALiNTRY360's expertise ensures a tailored solution that meets the unique needs of any healthcare practice, from small clinics to large hospital systems.
For more info visit us https://valintry360.com/solutions/health-life-sciences
Artificia Intellicence and XPath Extension FunctionsOctavian Nadolu
The purpose of this presentation is to provide an overview of how you can use AI from XSLT, XQuery, Schematron, or XML Refactoring operations, the potential benefits of using AI, and some of the challenges we face.
Measures in SQL (SIGMOD 2024, Santiago, Chile)Julian Hyde
SQL has attained widespread adoption, but Business Intelligence tools still use their own higher level languages based upon a multidimensional paradigm. Composable calculations are what is missing from SQL, and we propose a new kind of column, called a measure, that attaches a calculation to a table. Like regular tables, tables with measures are composable and closed when used in queries.
SQL-with-measures has the power, conciseness and reusability of multidimensional languages but retains SQL semantics. Measure invocations can be expanded in place to simple, clear SQL.
To define the evaluation semantics for measures, we introduce context-sensitive expressions (a way to evaluate multidimensional expressions that is consistent with existing SQL semantics), a concept called evaluation context, and several operations for setting and modifying the evaluation context.
A talk at SIGMOD, June 9–15, 2024, Santiago, Chile
Authors: Julian Hyde (Google) and John Fremlin (Google)
https://doi.org/10.1145/3626246.3653374
When it is all about ERP solutions, companies typically meet their needs with common ERP solutions like SAP, Oracle, and Microsoft Dynamics. These big players have demonstrated that ERP systems can be either simple or highly comprehensive. This remains true today, but there are new factors to consider, including a promising new contender in the market that’s Odoo. This blog compares Odoo ERP with traditional ERP systems and explains why many companies now see Odoo ERP as the best choice.
What are ERP Systems?
An ERP, or Enterprise Resource Planning, system provides your company with valuable information to help you make better decisions and boost your ROI. You should choose an ERP system based on your company’s specific needs. For instance, if you run a manufacturing or retail business, you will need an ERP system that efficiently manages inventory. A consulting firm, on the other hand, would benefit from an ERP system that enhances daily operations. Similarly, eCommerce stores would select an ERP system tailored to their needs.
Because different businesses have different requirements, ERP system functionalities can vary. Among the various ERP systems available, Odoo ERP is considered one of the best in the ERp market with more than 12 million global users today.
Odoo is an open-source ERP system initially designed for small to medium-sized businesses but now suitable for a wide range of companies. Odoo offers a scalable and configurable point-of-sale management solution and allows you to create customised modules for specific industries. Odoo is gaining more popularity because it is built in a way that allows easy customisation, has a user-friendly interface, and is affordable. Here, you will cover the main differences and get to know why Odoo is gaining attention despite the many other ERP systems available in the market.
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Selenium - The page object pattern
1. The Page Object Pa-ern
A
basic
DRY
abstrac-on
pa1ern
for
Web
browser
automa-on
test
development,
maintenance
and
versioning
Alex
Kogon
alex@kogon.com
2. Basic Web Test Development
• What
do
we
do
in
Selenium
Web
Test
Development?
Just
like
the
user,
we
launch
a
Web
browser,
load
pages,
and
read,
write,
and
click
on
bu1ons
and
links.
• How
do
we
interact
with
the
Web
browser?
The
Web
browser
is
interface
via
an
Object
in
your
code,
which
can
be
told
to
load
pages,
and
queried
for
Element
Objects
that
are
currently
on
the
displayed
Web
page.
These
Element
Objects
may
be
read
from,
wri1en
to,
or
clicked
on.
3. A First Basic Selenium Script
1. Load
www.google.com
2. Find
the
search
text
field
3. Enter
“Alex
Kogon”
4. Find
the
search
bu1on
5. Click
on
it
4. A First Basic Selenium Script (Java)
public
class
BasicWebTest
{
private
WebDriver
theSeleniumWebDriver;
@Before
public
void
setUp()
throws
Exception
{
theSeleniumWebDriver
=
new
RemoteWebDriver(new
URL("http://localhost:4444/wd/hub"),
DesiredCapabilities.firefox());
}
@Test
public
void
test()
{
theSeleniumWebDriver.get("http://www.google.com");
final
WebElement
myGoogleInputElement
=
theSeleniumWebDriver.findElement(By.cssSelector("#lst-‐ib"));
myGoogleInputElement.sendKeys("Alex
Kogon");
final
WebElement
mySearchButtonElement
=
theSeleniumWebDriver.findElement(By.cssSelector("#tsf
>
div.tsf-‐p
>
div.jsb
>
center
>
input[type="submit"]:nth-‐child(1)"));
mySearchButtonElement.click();
}
}
5. Adding more searches
1. Load
www.google.com
2. Find
the
search
text
field
3. Enter
other
varia-ons
on
name
(“Alexander
Kogon”,
“Kogon,
Alex”)
4. Find
the
search
bu1on
5. Click
on
it
6. Another Search
@Test
public
void
anotherTest()
{
theSeleniumWebDriver.get("http://www.google.com");
final
WebElement
myGoogleInputElement
=
theSeleniumWebDriver.findElement(By.cssSelector("#lst-‐ib"));
myGoogleInputElement.sendKeys("Kogon,
Alex");
final
WebElement
mySearchButtonElement
=
theSeleniumWebDriver.findElement(By.cssSelector("#tsf
>
div.tsf-‐p
>
div.jsb
>
center
>
input[type="submit"]:nth-‐
child(1)"));
mySearchButtonElement.click();
}
7. Et cetera…
@Test
public
void
yetAnotherTest()
{
theSeleniumWebDriver.get("http://www.google.com");
final
WebElement
myGoogleInputElement
=
theSeleniumWebDriver.findElement(By.cssSelector("#lst-‐ib"));
myGoogleInputElement.sendKeys("Alexander
Kogon");
final
WebElement
mySearchButtonElement
=
theSeleniumWebDriver.findElement(By.cssSelector("#tsf
>
div.tsf-‐p
>
div.jsb
>
center
>
input[type="submit"]:nth-‐child(1)"));
mySearchButtonElement.click();
}
@Test
public
void
andSoAnotherTest()
{
theSeleniumWebDriver.get("http://www.google.com");
final
WebElement
myGoogleInputElement
=
theSeleniumWebDriver.findElement(By.cssSelector("#lst-‐ib"));
myGoogleInputElement.sendKeys("Kogon,
Alexander");
final
WebElement
mySearchButtonElement
=
theSeleniumWebDriver.findElement(By.cssSelector("#tsf
>
div.tsf-‐p
>
div.jsb
>
center
>
input[type="submit"]:nth-‐child(1)"));
mySearchButtonElement.click();
}
8. Eureka!
Isn’t
this
great?
With
almost
no
effort
we
can
write
test
scripts
building
new
func-onality
from
what
we’ve
already
done
by
copying
and
pas-ng
the
exis-ng
work
we’ve
done
and
modifying
a
couple
things.
9. So what’s the problem?
How
about
if
something
changes?
By
building
a
test
from
an
exis-ng
site
and
copying
the
CSS
selectors,
it
is
easy
to
build
a
large
body
of
func-onality
tests.
However,
what
happens
if
the
CSS
selectors
(or
other
underlying
func-onality)
change?
10. Bri-le Selectors
Please
give
us
a
unique
selector!
When
construc-ng
selectors,
there
are
a
variety
of
op-ons
on
how
it
may
be
done.
The
best
selectors
reference
unique
iden-fiers
associated
with
the
HTML
element,
like
the
Google
Search
Text
Field
in
our
example
code:
theSeleniumWebDriver.findElement(By
.cssSelector("#lst-‐ib"));
However,
quite
oben
the
developers
have
not
inserted
unique
tags,
and
we
get
a
selector
similar
to
what
we
used
for
the
Google
Search
Bu1on
in
our
example
code:
final
WebElement
mySearchButtonElement
=
theSeleniumWebDriver
.findElement(By
.cssSelector("#tsf
>
div.tsf-‐p
>
div.jsb
>
center
>
input[type="submit"]:nth-‐child(1)"));
11. What Happens When Selectors Change?
Layout
based
selectors
are
a
headache…
Look
at
the
second
selector
again:
cssSelector("#tsf
>
div.tsf-‐p
>
div.jsb
>
center
>
input[type="submit"]:nth-‐child(1)"));
With
a
bit
of
knowledge
of
CSS
selectors,
you
can
see
that
this
is
querying
a
subsec-on
of
the
page
for
all
of
it’s
submit
bu1ons,
and
asking
for
the
first
one.
What
if
the
layout
of
the
page
changed,
or
there
was
another
bu1on
inserted
before
it?
Suddenly
either
no
bu1on
will
be
found
or
the
wrong
one
clicked.
Ideally,
the
developers
can
be
convinced
to
insert
unique
selectors
into
every
element
you
need
to
access,
but
oben
this
is
not
the
case.
How
to
handle
the
changes?
12. Brute Force
Search
and
Replace
So
let’s
assume
the
guys
at
Google
put
in
another
bu1on
before
the
search
bu1on.
Our
CSS
selector
now
looks
like:
cssSelector("#tsf
>
div.tsf-‐p
>
div.jsb
>
center
>
input[type=
"submit"]:nth-‐child(2)"));
OK,
well
we’ve
got
four
uses
of
this
selector,
but
they
are
all
in
the
same
file,
so
searching
and
replacing
is
not
the
end
of
the
world.
What
about
if
we
had
hundreds?
And
they
were
in
different
files?
What
if
we
just
had
to
change
it
once?
While
copying
and
pas-ng
code
all
over
is
easy
and
convenient
for
reuse,
it
creates
a
lot
of
extra
busy
work
when
something
needs
to
be
changed.
By
crea-ng
a
“Single
Point
Of
Truth”,
or
a
single
way
in
which
this
selector
is
accessed,
we
only
need
to
change
it
once.
A
bit
of
extra
work
up
front
to
save
a
lot
of
work
in
the
future.
13. Don’t Repeat Yourself (DRY)
Encapsulate
code
in
a
single
loca-on
OK,
so
we’ve
copied
the
same
code
in
four
places,
and
now
we
need
to
change
it.
To
do
so
most
easily,
we
would
like
to
only
have
to
change
it
once.
What
do
we
do?
Refactor.
One
of
the
most
powerful
innova-ons
in
modern
IDE’s
is
the
ability
to
automa-cally
have
the
IDE
change
code,
a.k.a.
“refactoring”.
Refactoring
allows
you
to
change
the
architecture
of
your
code
on
the
fly,
adop-ng
more
complicated
structures
as
demanded,
while
keeping
things
as
simple
as
possible
at
the
-me.
There
are
several
possible
solu-ons
for
how
to
refactor
this
code
to
be
DRY;
we
will
work
with
extrac-ng
a
common
method
that
is
accessed
from
all
the
tests.
14. What if the Selector is used across mulOple
script files?
Share
methods
within
a
u-lity
class
So
now
we’ve
created
a
single
method
containing
the
CSS
Selector
that
can
be
easily
modified
to
update
the
Selector
when
it
changes.
However,
that
method
is
only
in
one
class.
If
the
selector
is
used
from
mul-ple
test
script
class
files,
the
change
must
be
implemented
in
each
one.
Wouldn’t
it
be
easier
to
just
move
the
method
to
another
class
where
it
could
be
shared
by
all
the
different
test
scripts?
The
“Move”
refactor
is
also
quite
helpful
in
doing
this.
15. The Page Object Pa-ern
Break
your
u-lity
classes
out
by
Page
The
u-lity
class
we
have
just
created
contains
all
the
logic
to
access
elements
on
the
Web
pages
we
use
in
our
test.
Assuming
there
are
many
Web
pages,
they
are
all
mixed
together
in
our
class.
By
breaking
out
the
u-lity
class
into
separate
classes,
each
with
the
accessors
for
a
single
Web
page,
we
create
a
be1er
abstrac-on
where
we
can
easily
share
func-onality
across
our
test
suite
by
bringing
in
(and
extending)
exis-ng
Page
Object
code
for
each
page
a
test
uses.
16. Code
Page Object Pa-ern Architecture
Google
Home
Page
Google
Search
Result
Page
Google
Home
Page
Object
Google
Search
Result
Page
Object
Page Objects
Web Pages
Test
1
Test
2
Test
3
Test Scripts
17. Maven and Page Objects
Store
each
page
as
a
library
in
Maven
Now
that
we’ve
broken
up
our
accessors
into
Page
Objects
so
they
can
be
easily
shared
across
test
scripts,
why
not
put
them
into
a
separate
module
so
that
they
can
be
easily
shared
across
test
projects
as
well?
By
pugng
each
Page
Object
into
a
unique
Maven
module,
tests
can
simply
define
all
the
Page
Objects
they
need
to
reference
in
their
Maven
configura-on
(pom.xml)
file,
and
have
access
to
the
Page
Objects
without
needing
to
copy
the
Page
Objects
into
mul-ple
projects
(another
DRY
viola-on)
or
have
them
all
in
a
single
project.
18. Maven, Page Objects, and Versioning
Added
benefits
of
using
Maven
OK,
now
we’ve
encapsulated
each
of
our
CSS
selectors
in
a
single
accessor
method,
stored
each
of
these
in
a
unique
Object
represen-ng
each
Web
page
used,
and
created
a
Maven
library
for
this
Page
Object.
What
next?
When
running
Web
automa-on
tes-ng
in
a
large,
dynamic,
organiza-on,
you
will
find
quite
oben
that
there
are
mul-ple
versions
of
each
Web
page
that
must
be
tested
simultaneously.
Reliability
tes-ng
on
the
live
site
requires
the
version
currently
in
live
is
tested;
integra-on
tes-ng
on
imminent
releases
require
the
version
ready
for
release;
and
development
tes-ng
on
new
versions
of
the
Web
page
(perhaps
a
pipeline
of
mul-ple
future
releases)
require
the
version
for
each
of
those
pages.
Luckily
Maven
already
provides
us
with
a
solu-on.
Maven
libraries
are
easily
versioned
for
deployment,
such
that
many
versions
of
the
library
can
be
available
for
use
by
the
tests
depending
on
which
version
of
each
page
is
to
be
tested.
A
single
test
script
is
s-ll
able
to
be
used
on
the
various
versions,
as
the
differences
in
the
implementa-on
in
each
version
is
abstracted
behind
the
Page
Object.
19. Code
Page Object Pa-ern Versioning
Google
Home
Page
0.0.1
Google
Home
Page
0.0.2
Google
Home
Page
Object
V
0.0.1
Google
Home
Page
Object
V
0.0.2
Page Objects
Web Pages
Test
1
Test
2
Test
3
Test Scripts
20. ConOnuous Deployment and IntegraOon
The
full
enchilada
Now
that
we’ve
got
reusable,
versioned
Page
Objects
referenced
from
our
Web
script
code
via
Maven,
and
automated
tests
which
leverage
the
page
objects
by
version,
let’s
see
how
this
works
in
our
Automa-on
solu-ons.
A
Con-nuous
Deployment
and
Integra-on
system
can
be
easily
leveraged
to
provide
tes-ng
across
all
the
mul-ple
versions
in
real
-me.
By
allowing
the
defini-on
of
the
version
of
each
page
to
be
deployed
for
each
tes-ng
to
be
defined,
the
correct
version
of
each
Page
can
be
deployed
into
the
Web
applica-on
servers
for
the
test
run,
and
the
correct
version
of
each
Page
Object
corresponding
to
that
Page
version
used
(by
the
iden-cal
test)
by
dynamically
instruc-ng
Maven
to
use
the
same
version
of
the
Page
Object
that
was
just
deployed
for
tes-ng.
In
this
way
it
is
very
easy
to
test
mul-ple
integra-on
scenarios
in
real
-me
(produc-on,
integra-on,
development,
etc.),
and
to
easily
test
any
possible
integra-on
of
versions
by
simply
defining
the
versions
to
be
used
for
an
Automa-on
run.
Try
doing
that
with
hard
coding.
21. ConOnuous IntegraOon with Versioning
Jenkins
ConOnuous
IntegraOon
Server
Trigger
0.0.1
Build
Checkout
0.0.1
Branch
Git
Version
Control
Server
Build
0.0.1
Branch
Nexus
Maven
Deployment
Server
Tomcat
Web
ApplicaOon
Server
Deploy
0.0.1
Branch
Run
0.0.1
Test
Maven
Test
Runner
Run
With
0.0.1
Page
Object
Selenium
Test
Run
Firefox
Drive
Browser
Deliver
0.0.1
Page
Objects
Deliver
0.0.1
Pages