The document discusses moving beyond traditional page object models for testing dynamic web applications. It proposes modeling the UI with smaller "page components" that use method chaining and return types to better reflect the user experience. It also suggests using a component factory and locators to simplify test code and address issues like synchronization. The goal is to make tests more readable, reusable and robust as applications become more interactive.
An overview of the Infusion JavaScript application framework and its value for creating accessible open Web apps. Presented at a Fluid Community Workshop in Toronto, September 2010.
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.
A journey beyond the page object patternRiverGlide
A story of one organisation taking an idea, formed by Antony Marcano and evolved by many, to solve some of the challenges that encountered with the growth of Selenium/WebDriver PageObjects in their Automated Tests. Talk co-presented with two of the people who have been a part of the journey – including Kostas Mamalis & Jan Molak.
Every test tells a story, but some tell a better story than others. Every test illustrates a specific path through the system to achieve a specific goal, but some paths are clearer than others. Valuable tests are the ones that tell a compelling story.
Come on a journey of discovery to learn how to write such tests, and witness a demonstration of these principles in action, with live coding of Serenity BDD automated tests.
An overview of the Infusion JavaScript application framework and its value for creating accessible open Web apps. Presented at a Fluid Community Workshop in Toronto, September 2010.
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.
A journey beyond the page object patternRiverGlide
A story of one organisation taking an idea, formed by Antony Marcano and evolved by many, to solve some of the challenges that encountered with the growth of Selenium/WebDriver PageObjects in their Automated Tests. Talk co-presented with two of the people who have been a part of the journey – including Kostas Mamalis & Jan Molak.
Every test tells a story, but some tell a better story than others. Every test illustrates a specific path through the system to achieve a specific goal, but some paths are clearer than others. Valuable tests are the ones that tell a compelling story.
Come on a journey of discovery to learn how to write such tests, and witness a demonstration of these principles in action, with live coding of Serenity BDD automated tests.
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.
Behaviour Driven Development is a powerful collaboration technique that can empower teams to deliver higher value features to the business faster and more effectively. But although Behaviour Driven Development is based on a number of simple principles, it can go dramatically wrong in a myriad of different ways.
In this talk we discuss twelve BDD anti-patterns we frequently encounter in real-world BDD projects, anti-patterns that can dramatically reduce the effectiveness of BDD as a practice, and that can even cause BDD adoption to fail entirely. Looking at everything from insufficient collaboration practices to poor use of test automation tooling, from teams that test too much to teams that forget the most important scenarios, we will look at the many different ways that BDD can go wrong, and how it should be done.
We will use real-world examples to illustrate each of these anti-patterns. You will learn how to spot these issues in your own projects, and more importantly how to avoid them in the first place.
Page-Object pattern is very commonly used when implementing Automation frameworks. However, as the scale of the framework grows, there is a limitation on how much reusability really happens. It inherently becomes very difficult to separate the test intent from the business domain.
I talk about this problem, and the solution I have been using - Business Layer - Page-Object pattern, which has helped me keep my code DRY.
For more details (links to slides, etc.), see my blog: http://goo.gl/biRn4n
“Specification by Example” is a set of process patterns that helps to validate the application for faster feedback and minimal documentation. With Specification by Example, teams write just enough documenta- tion to facilitate change effectively in short iterations or in flow-based development.
Specification by Example talk given at Software Craftsmanship and Testing Camp in Germany, 2011. This talk is focused on the "why" and the "what" of Specification by Example.
Refactoring page objects The Screenplay Pattern RiverGlide
As seen at BDD Exchange 2016 and Selenium Conf 2016
The Screenplay Pattern, first created by Antony Marcano, is an alternative model to PageObjects. Today, it is growing in popularity with increasing tool support in popular testing frameworks.
PageObjects provide an easy-to-follow, simple structure that avoids early maintenance issues. They were introduced to help test-developers avoid mistaking flaky tests for problems with Selenium. But, PageObjects break some key OO design rules, making maintenance more difficult over time. They are a useful first step, but why do we stop there?
In this session you’ll learn about the SOLID design principles that PageObjects disregard. You’ll see why this leads to problems. You’ll see how and why PageObjects benefit from refactoring to SOLID design principles. Finally, you’ll meet the Screenplay Pattern – an alternative model based on SOLID principles that saves you the trouble.
Сергей Татаринцев — Тестирование CSS-регрессий с GeminiYandex
Каждый разработчик интерфейсов долгоживущих сервисов сталкивается с регрессиями в вёрстке. Мы научились пользоваться инструментами для unit-тестирования js-кода, но до сих пор плохо понимаем, как тестировать на регрессии вёрстку. И ещё хуже понимаем, как делать это автоматически (continuous integration) и при этом писать небольшие и не очень хрупкие тесты. В этом году мы создали Gemini — инструмент для модульного тестирования вёрстки для нашей библиотеки компонентов. Мы используем его для тестирования внутренней библиотеки компонентов Яндекса, которая лежит в основе большинства наших сервисов (например, Поиска и Картинок). На BEMup я расскажу, как использовать этот инструмент — как разрабатывать тесты и запускать их на локальной машине или в уже существующей экосистеме (Travis CI, Sauce Labs).
Learn how to plan, prioritise and deliver higher value features by thinking of deliverable features not in terms of what they cost, but of what they can deliver.
XScale is a set of practices based on BDD that enables a product team to efficiently define, budget and prioritise a roadmap or backlog.
It’s also a way to answer some questions Agile has traditionally avoided:
- How much will a set of features cost?
- How do we trade off different feature sets?
- How do we know a feature is ready to ship?
In this workshop, we outline several key practices and practice using a few of them. The main practices we cover include:
- Feature Points, a way to reconcile budgets with story points
- Backlog Bingo determines the dollar investment and relative return for a set of products and services
- Royal Cod applies Backlog Bingo to prioritize a Breadth-First Roadmap
- Release Refactoring enables product owners to make rational trade-offs between feature-sets.
Design patterns in web testing automation with WebDriverMikalai Alimenkou
Design patters exist for years in software development. Some developers love them, some think they are useless. But design patters has very clear goals: describe common solutions for common problems, create shared language for community, improve understanding and reuse of existing approaches. Testing automation has its own set of problems, so there is a set of helpful design patterns for this area. In this talk I will run through all known patterns and describe them in details with several practical samples.
Moving Towards Zero Defects with Specification by ExampleSteve Rogalsky
Love tracing bugs in a defect tracking system? Love the bug-fix cycle? If so, then don't come to this presentation. We'll be discussing how Specification by Example (also known as Acceptance Test Driven Development) will help move you towards a zero defect system by building the right thing the first time.
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.
Behaviour Driven Development is a powerful collaboration technique that can empower teams to deliver higher value features to the business faster and more effectively. But although Behaviour Driven Development is based on a number of simple principles, it can go dramatically wrong in a myriad of different ways.
In this talk we discuss twelve BDD anti-patterns we frequently encounter in real-world BDD projects, anti-patterns that can dramatically reduce the effectiveness of BDD as a practice, and that can even cause BDD adoption to fail entirely. Looking at everything from insufficient collaboration practices to poor use of test automation tooling, from teams that test too much to teams that forget the most important scenarios, we will look at the many different ways that BDD can go wrong, and how it should be done.
We will use real-world examples to illustrate each of these anti-patterns. You will learn how to spot these issues in your own projects, and more importantly how to avoid them in the first place.
Page-Object pattern is very commonly used when implementing Automation frameworks. However, as the scale of the framework grows, there is a limitation on how much reusability really happens. It inherently becomes very difficult to separate the test intent from the business domain.
I talk about this problem, and the solution I have been using - Business Layer - Page-Object pattern, which has helped me keep my code DRY.
For more details (links to slides, etc.), see my blog: http://goo.gl/biRn4n
“Specification by Example” is a set of process patterns that helps to validate the application for faster feedback and minimal documentation. With Specification by Example, teams write just enough documenta- tion to facilitate change effectively in short iterations or in flow-based development.
Specification by Example talk given at Software Craftsmanship and Testing Camp in Germany, 2011. This talk is focused on the "why" and the "what" of Specification by Example.
Refactoring page objects The Screenplay Pattern RiverGlide
As seen at BDD Exchange 2016 and Selenium Conf 2016
The Screenplay Pattern, first created by Antony Marcano, is an alternative model to PageObjects. Today, it is growing in popularity with increasing tool support in popular testing frameworks.
PageObjects provide an easy-to-follow, simple structure that avoids early maintenance issues. They were introduced to help test-developers avoid mistaking flaky tests for problems with Selenium. But, PageObjects break some key OO design rules, making maintenance more difficult over time. They are a useful first step, but why do we stop there?
In this session you’ll learn about the SOLID design principles that PageObjects disregard. You’ll see why this leads to problems. You’ll see how and why PageObjects benefit from refactoring to SOLID design principles. Finally, you’ll meet the Screenplay Pattern – an alternative model based on SOLID principles that saves you the trouble.
Сергей Татаринцев — Тестирование CSS-регрессий с GeminiYandex
Каждый разработчик интерфейсов долгоживущих сервисов сталкивается с регрессиями в вёрстке. Мы научились пользоваться инструментами для unit-тестирования js-кода, но до сих пор плохо понимаем, как тестировать на регрессии вёрстку. И ещё хуже понимаем, как делать это автоматически (continuous integration) и при этом писать небольшие и не очень хрупкие тесты. В этом году мы создали Gemini — инструмент для модульного тестирования вёрстки для нашей библиотеки компонентов. Мы используем его для тестирования внутренней библиотеки компонентов Яндекса, которая лежит в основе большинства наших сервисов (например, Поиска и Картинок). На BEMup я расскажу, как использовать этот инструмент — как разрабатывать тесты и запускать их на локальной машине или в уже существующей экосистеме (Travis CI, Sauce Labs).
Learn how to plan, prioritise and deliver higher value features by thinking of deliverable features not in terms of what they cost, but of what they can deliver.
XScale is a set of practices based on BDD that enables a product team to efficiently define, budget and prioritise a roadmap or backlog.
It’s also a way to answer some questions Agile has traditionally avoided:
- How much will a set of features cost?
- How do we trade off different feature sets?
- How do we know a feature is ready to ship?
In this workshop, we outline several key practices and practice using a few of them. The main practices we cover include:
- Feature Points, a way to reconcile budgets with story points
- Backlog Bingo determines the dollar investment and relative return for a set of products and services
- Royal Cod applies Backlog Bingo to prioritize a Breadth-First Roadmap
- Release Refactoring enables product owners to make rational trade-offs between feature-sets.
Design patterns in web testing automation with WebDriverMikalai Alimenkou
Design patters exist for years in software development. Some developers love them, some think they are useless. But design patters has very clear goals: describe common solutions for common problems, create shared language for community, improve understanding and reuse of existing approaches. Testing automation has its own set of problems, so there is a set of helpful design patterns for this area. In this talk I will run through all known patterns and describe them in details with several practical samples.
Moving Towards Zero Defects with Specification by ExampleSteve Rogalsky
Love tracing bugs in a defect tracking system? Love the bug-fix cycle? If so, then don't come to this presentation. We'll be discussing how Specification by Example (also known as Acceptance Test Driven Development) will help move you towards a zero defect system by building the right thing the first time.
As a PHP developer, you've probably had to deal with Javascript at some point in your career. Some of the Javascript code you've written may even have been pretty complex. What happens if you need to make some changes? Will it break existing functionality? The only way to really know if everything is still working, is by unit testing your Javascript. This talk will introduce you to QUnit for creating Javascript unit tests and JsTestDriver for automating these tests.
Javascript Views, Client-side or Server-side with NodeJSSylvain Zimmer
A talk I gave at the Paris Node Meetup on June 8th 2011, in front of all the best JS developers in Paris and NodeJS creator Ryan Dahl.
I hope it will make some devs avoid some of the horrible hashbang practices we see on websites like the new twitter !
Practical tips to make a website more accessible to different devices, technologies, and interactions. Presented April 12, 2011 for the WordPress DC Meetup.
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
Welcome to the first live UiPath Community Day Dubai! Join us for this unique occasion to meet our local and global UiPath Community and leaders. You will get a full view of the MEA region's automation landscape and the AI Powered automation technology capabilities of UiPath. Also, hosted by our local partners Marc Ellis, you will enjoy a half-day packed with industry insights and automation peers networking.
📕 Curious on our agenda? Wait no more!
10:00 Welcome note - UiPath Community in Dubai
Lovely Sinha, UiPath Community Chapter Leader, UiPath MVPx3, Hyper-automation Consultant, First Abu Dhabi Bank
10:20 A UiPath cross-region MEA overview
Ashraf El Zarka, VP and Managing Director MEA, UiPath
10:35: Customer Success Journey
Deepthi Deepak, Head of Intelligent Automation CoE, First Abu Dhabi Bank
11:15 The UiPath approach to GenAI with our three principles: improve accuracy, supercharge productivity, and automate more
Boris Krumrey, Global VP, Automation Innovation, UiPath
12:15 To discover how Marc Ellis leverages tech-driven solutions in recruitment and managed services.
Brendan Lingam, Director of Sales and Business Development, Marc Ellis
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofsAlex Pruden
This paper presents Reef, a system for generating publicly verifiable succinct non-interactive zero-knowledge proofs that a committed document matches or does not match a regular expression. We describe applications such as proving the strength of passwords, the provenance of email despite redactions, the validity of oblivious DNS queries, and the existence of mutations in DNA. Reef supports the Perl Compatible Regular Expression syntax, including wildcards, alternation, ranges, capture groups, Kleene star, negations, and lookarounds. Reef introduces a new type of automata, Skipping Alternating Finite Automata (SAFA), that skips irrelevant parts of a document when producing proofs without undermining soundness, and instantiates SAFA with a lookup argument. Our experimental evaluation confirms that Reef can generate proofs for documents with 32M characters; the proofs are small and cheap to verify (under a second).
Paper: https://eprint.iacr.org/2023/1886
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Enhancing Performance with Globus and the Science DMZGlobus
ESnet has led the way in helping national facilities—and many other institutions in the research community—configure Science DMZs and troubleshoot network issues to maximize data transfer performance. In this talk we will present a summary of approaches and tips for getting the most out of your network infrastructure using Globus Connect Server.
The Metaverse and AI: how can decision-makers harness the Metaverse for their...Jen Stirrup
The Metaverse is popularized in science fiction, and now it is becoming closer to being a part of our daily lives through the use of social media and shopping companies. How can businesses survive in a world where Artificial Intelligence is becoming the present as well as the future of technology, and how does the Metaverse fit into business strategy when futurist ideas are developing into reality at accelerated rates? How do we do this when our data isn't up to scratch? How can we move towards success with our data so we are set up for the Metaverse when it arrives?
How can you help your company evolve, adapt, and succeed using Artificial Intelligence and the Metaverse to stay ahead of the competition? What are the potential issues, complications, and benefits that these technologies could bring to us and our organizations? In this session, Jen Stirrup will explain how to start thinking about these technologies as an organisation.
15. Readability
selenium.click(“id=itemAction1138”);
assertEquals(“1”, selenium.getText(“css=#cart .count”));
vs.
item.clickAddToCart();
assertEquals(1, cart.getItemCount());
Wednesday, 06 April, 2011
16. Stay DRY
Test class:
selenium.click(“id=zoom_out_action”);
selenium.click(“id=zoom_out_action”);
vs.
Test class:
map.zoomOut();
map.zoomOut();
Map class:
selenium.click(“id=zoom_out_action”);
Wednesday, 06 April, 2011
17. Robustitude
Thread.sleep(250); //wait for button to appear
selenium.click(“id=a_button”);
Thread.sleep(500); //wait for results to show up
assertEquals(selenium.getText(“id=results”),
“False Negatives suck!”);
Wednesday, 06 April, 2011
20. How Do We Get
There?
• Refactoring
• Apply Design Patterns
• Continuous Improvement
Wednesday, 06 April, 2011
21. How Do We Get
There?
Wednesday, 06 April, 2011
22. Context
• Several consulting gigs over the past few
years
• Current client:
• consumer-facing RIA
• tests written with Selenium 1 API in Java
Wednesday, 06 April, 2011
23. PRO TIP
Use WebDriver
Wednesday, 06 April, 2011
24. Page Objects Recap
• Model the application’s UI
• Expose methods that reflect the things a
user can see and do on that page
• Hides the details of telling the browser
how to do those things
Wednesday, 06 April, 2011
25. Page Object Benefits
• Readable tests
• Reduced or eliminated duplication
• Self-verification
• Reusability
Wednesday, 06 April, 2011
26. So Why Go “Beyond”?
Web Apps Are Different Now
Wednesday, 06 April, 2011
27. Why Go “Beyond”?
meh
OMG SOOO MUCH BETTER
Wednesday, 06 April, 2011
32. Modeling The UI
public class IssueSummary {
public IssueDetail expand() {...}
}
public class IssueDetail {
public void save() {...}
public void cancel() {...}
public String getStoryId() {...}
}
Wednesday, 06 April, 2011
33. What’s This, Then?
I call them “Page Components”
Wednesday, 06 April, 2011
34. Method Chaining: Focus
Stays Put
public class IssueDetail {
public void save() {...}
public IssueDetail addComment(String comment) {
...
return this;
}
}
issueDetail.addComment().save();
Wednesday, 06 April, 2011
35. Method Chaining: Focus
Moves Elsewhere
public class IssueDetail {
public ConfirmationDialog delete() {
...
return new ConfirmationDialog();
}
}
issueDetail.delete().confirm();
or
issueDetail.delete().cancel();
Wednesday, 06 April, 2011
36. Page Component
Recap
• Just like Page Objects... but littler
• Use return types to model the user
experience
Wednesday, 06 April, 2011
37. ComponentFactory
Do you like to type? I don’t.
Wednesday, 06 April, 2011
39. ComponentFactory
public class ComponentFactory {
public IssueSummary issueSummary() {
return new IssueSummary(...);
}
}
public abstract BaseTestCase {
protected ComponentFactory withComponent() {
return new ComponentFactory();
}
}
Wednesday, 06 April, 2011
40. ComponentFactory
new IssueSummary(selenium).expand();
vs.
withComponent().issueSummary().expand();
Wednesday, 06 April, 2011
41. ComponentFactory
Recap
• Interactive documentation
• Easier entry point into component creation
• Another way to use strong typing to make
the tests easier to write
Wednesday, 06 April, 2011
44. Indexed Components
CSS locators:
Backlog = #backlog
First issue summary = #backlog .issue-summary:nth(0)
“Expand” button = #backlog .issue-summary:nth(0) .expand
Title = #backlog .issue-summary:nth(0) .title
Wednesday, 06 April, 2011
45. The Locator Class
public class Locator {
protected int index;
public Locator(String rootLocator, int index) {
this.rootLocator = rootLocator;
this.index = index;
}
public String of(String containedElement) {
return String.format(rootLocator, index) +
" " + containedElement;
}
}
Wednesday, 06 April, 2011
46. Using A Locator
public IssueDetail expand() {
selenium.click(“#backlog .issue-summary:nth(0) .expand”);
...
}
vs.
public IssueDetail expand() {
selenium.expand(locator.of(“.expand”));
...
}
Wednesday, 06 April, 2011
47. Synchronization Issues
Two kinds:
1. Element not present yet
2. Element content not updated yet
Wednesday, 06 April, 2011
48. Thread.sleep()
NO.*
STEP AWAY FROM THE KEYBOARD.
Wednesday, 06 April, 2011
49. Thread.sleep()
NO.*
STEP AWAY FROM THE KEYBOARD.
(*unless you have no other choice)
Wednesday, 06 April, 2011
50. Thread.sleep()
Just be sure to wrap it in an appropriately named method:
Wednesday, 06 April, 2011
51. Thread.sleep()
Just be sure to wrap it in an appropriately named method:
• sleepAsALastResortWhenNothingElseWorks()
Wednesday, 06 April, 2011
52. Thread.sleep()
Just be sure to wrap it in an appropriately named method:
• sleepAsALastResortWhenNothingElseWorks()
• sleepToMakeThisTestMoreFlakyThusEnsuringMyJobSecurity()
Wednesday, 06 April, 2011
53. Thread.sleep()
Just be sure to wrap it in an appropriately named method:
• sleepAsALastResortWhenNothingElseWorks()
• sleepToMakeThisTestMoreFlakyThusEnsuringMyJobSecurity()
• sleepBecauseImTooLazyToSolveThisProperly()
Wednesday, 06 April, 2011
54. Use The Wait Class
...to delay the test until the app exhibits
certain behavior rather than waiting for an
arbitrary amount of time.
Wednesday, 06 April, 2011
55. Two Options
1. Subclass DefaultSelenium and override the
click() method
2. Extract a BaseComponent class that
provides a click() method for use by all
subclasses
Wednesday, 06 April, 2011
56. Next Issue
The element is present in the DOM, but
doesn't contain the right data yet.
Wednesday, 06 April, 2011
57. Cleanest Solution
Build the app for testability
Wednesday, 06 April, 2011
58. Next Best Solution
public IssueDetail addComment() {
int initialCount = getCommentCount();
selenium.type(locator.of(“.comment-entry”));
selenium.click(locator.of(“.add-comment”));
waitUntilCommentCountIs(initialCount + 1);
return this;
}
Wednesday, 06 April, 2011
59. Final Thoughts
Beyond “Beyond”?
Wednesday, 06 April, 2011
60. Thank You!
http://electronicingenuity.com
dante@electronicingenuity.com
@dantebriones
Wednesday, 06 April, 2011
61. References
• Dan North on Best Practices:
• http://www.viddler.com/explore/kvarnhammar/videos/6/
• Adam Goucher on built-in test synchronization:
• http://saucelabs.com/blog/index.php/2011/02/advanced-selenium-
synchronization-with-latches/
Wednesday, 06 April, 2011