Synchronisation is one of the most important skills we have to learn when we're
automating on the web, APIs, anywhere. So,
I'm going to show you a site that you can use to practise on and a new online
course that I've got that covers all the examples using this particular site.
So, this is the SyncHole. You can find it on eviltester.github.io/synchole.
And it's a small app with a bunch of harder to synchronise things.
So, we've got stuff that's controlled by CSS where you have to click on a link;
simple form submission, where when you submit forms,
various things happen with JavaScript, when you get to the other side,
buttons that are added dynamically onto the page that you have to wait for
things to happen, events which are going on which are hard to synchronise,
messages going back and forward to the server that we have to wait for.
And different ways of synchronising on this. So,
there's different combinations of WebDriver wait using JavaScript,
synchronising with expected conditions,
making our own conditions using various other implicit waits or explicit waits.
I cover a tonne of stuff on this course over on LinkedIn learning and there'll
be a link to it from my website. If you have a look at the online courses there,
I'll have a link in the video description somewhere. But synchronisation -
very often I see teams using one or two approaches.
And what we really want is to understand is,
as many different approaches to synchronisation as we can so that we have a lot
of variety open to us when we're faced with real life problems.
So, I've tried to look at all the different things that I tell teams.
Different ways that we can approach synchronisation.
And I've crammed it into this course.
It's all pretty much hands on lectures. So you'll see me coding,
writing code to deal with the things on this small application.
And I'm explaining the theory as we go through the pros and cons.
And, when does WebDriver itself synchronise on the page?
How much JavaScript does it synchronise on?
How does WebDriver know when something has loaded? When it hasn't?
And what's the difference between an implicit wait and an explicit wait?
And how do we harness that in WebDriver?
And what are the inbuilt synchronisation classes?
And how do we use them? How do we write our own custom synchronisation points?
How do we harness JavaScript and use that to synchronise effectively on the
page?
This is really important when it comes to modern web applications that are doing
lots of Ajax calls to the server or dynamically updating the the front end.
I look at external libraries that we can use. So,
because sometimes there's a temptation when we're using WebDriver and in
combination with an API to use WebDriver to synchronise on the API or the file
system. There are other libraries that we can use that may be more appropriate.
So, I covered those in this course as well.
General hints and tips on working with remote WebDriver and just,
kind of, summarising all the stuff we go through. So I cover a lot.
I mean it doesn't take much to introduce a synchronisation problem.
Anyone that's worked on a project will see that there are flaky tests -builds
that that run and don't run.
And very often people move code into frameworks but don't synchronise
effectively, because we've lost it.
People are worried about putting too much synchronisation in their code in case
it slows it down.
I cover a tonne of stuff in here I think is one of the most important things
that we have to learn,
when we work with WebDriver.
But you can use the sample application on its own, the SyncHole,
eviltester.github.io/synchole if you want to practise.
And if you want to really learn it in detail,
we've got the course on LinkedIn learning. So,
you can work through that and see.
But do focus on synchronisation.
Do examine the synchronisation new approaches that you've got.
Look at the source code that's in WebDriver and see how they synchronise and
adopt more options rather than fewer.
Don't rely on just one or two approaches.
And if you find that your tests are flaky,
don't use retry mechanisms. Instead,
figure out how to make your code as well synchronised on the application state
as possible,
to avoid having retry mechanisms or just failing tests,
failing builds that run next time.
Because that can reduce the trust in your automated execution.
But hopefully that's a quick overview of the course.
But do have a look at the application and see how far you get.
But synchronisation is essential for our effective WebDriver automating.