all right so now that you know almost everything there is to know about
explicit waits and implicit waits I have an announcement to make that I've
been trying to tell you but I needed to teach you and show you everything first
so that you can understand that the impact of what has happened I've
actually written a blog post on this topic if you want to go to this URL and
take a look in more detail but basically about less than two weeks ago
selenium 3.11 was released and in there they've mentioned that two things are
happening one of them I'm not so much concerned about but the other one I am
very concerned about one of the things that they're doing is they're removing
the page factory from selenium not a big deal because I don't teach you how to
use it and you shouldn't really need to use it because it's very flaky and hard
to maintain the other huge announcement that they've made is that they're saying
goodbye to expected conditions that's cs they're removing it from the webdriver
dotnet implementation yes that's right what I have just showed you with
expected conditions will no longer be available in the selenium webdriver API
whenever you download the nougat package look yes it sucks and it's very annoying
I talked to Jim Evans and as you see there's a link there what he told me was
that the reason that they're making these changes is because it's too hard
to maintain the code in selenium and they want to reduce the complexity and
maintenance of the code for selenium and even though expected conditions are
extremely desired and highly used and very user friendly for us the developers
of test automation for whatever reason they're removing it I don't know if I
agree with it it doesn't make much sense to me to make something less user
friendly in order for code maintenance but again I don't maintain the selenium
code so I can't speak to how much maintenance it is now yes
it's very annoying and what you're gonna have to do is if
you don't use expected conditions you're gonna have to now start writing your own
linked queries like this that's exactly why I showed you this you're gonna need
to start writing your own these kinds of statements where you can find elements
where you can check elements for texts where you can check to see if an element
exists where the whether it's visible whether it's displayed all that kind of
stuff but then another easier solution is that you can actually download a new
special nougat package selenium has been kind enough to extract the code into a
different nougat package and we can actually use that one instead so let me
actually show you all of this so let me pull up my solution Explorer here and
I'm gonna come here a right-click and go to manage you get packages for the
solution and as you can see I've got some updates I'm actually on oh wow I'm
very outdated on my selenium as you can see some places have three seven some
have three four others have three eight so what I'm gonna do is actually update
for you to version 3.11 on both of these so I'm gonna go ahead and click all of
this of call of that c-sharp doesn't need
that so I'm gonna update all of these to 3.11 and I'm gonna install it give that
a second to update I'm gonna say okay that yes I want to update all of my new
get packages to the latest version of selenium they're all being updated and
it's always a good idea to keep your all your new get packages always on the
latest software and all of them to be the same across all projects it's just
kind of a quick heads-up while you know everything is downloading figured I'd
give you as much tips as possible so now that we've downloaded selenium webdriver
and you get packaged let me go ahead and build and rebuild the code and so now
this is going to pull down all of the latest new got packages
and
and there's a problem here because you can see that I still have old new got
package versions remaining here in my packages folder so I'm gonna go ahead
and delete them I figured that might happen but I thought that a new got
package manager would have cleaned it up but it didn't so now let me go ahead and
rebuild again I was getting weird airs about mismatching mismatching namespaces
in different versions so now this is still complaining
you
so what I'm gonna do here is a right click here and go to manage you get
packages and then as you can see I have some updates to install and they are for
selenium support so I'm gonna go ahead and click this because these are
currently version 3.7 but they can be upgraded to version 3.11 which is exactly
the version that I just talked about so I'm gonna go ahead and click update so
that it updates my new get packages in this project webdriver timeouts tutorial
so give that a second it's added all the packages and successfully installed
excellent so now let's go back and look at our output and if we look at the
error list what you now can see is this message that expected conditions is
obsolete the expected conditions implementations in the.net bindings is
deprecated and will be removed in a future release this portion of the code
has been migrated to dotnet selenium extras repository on the github so they
are super nice to point us to where it has been migrated but as they now say
this is now obsolete you can use it for now but in a future version it's going
to be gone and it's going to break your code so you can prepare for that now and
I'm gonna show you exactly how so because we'll even be able to see that
in our explicit waits um that you can see there's a green greed underlined
here that says you know expected conditions is obsolete so let's go ahead
and fix that and if we by looking at the error list we can see that it says
dotnet selenium extras so if we go into the solution Explorer come here right
click do you manage you get packages and browse and we're gonna go search for
dotnet selenium extras so there it is dot net selenium extras we don't need
the page objects but we do need the wait helpers
so we're actually going to install it currently as I'm talking to you
it's the end of March 2018 there is still no main maintainer of this
repository but it does work so I don't think it needs much changes and so this
version that I'm about to install 3.11 will be just fine
so I'm installing it and it's downloaded so now I can go back and
and now instead of using support dot UI which we can no longer use and so now of
course this will complain we can use using open QA of selenium extras that
wait helpers so that fix that and then of course this needs selenium support UI
there you go so now everything up expected conditions of course is going
to complain because it's ambiguous and so what we have to do is set using
static selenium extras dot wait helpers
not expected conditions
and so now this is gonna be great because the expected conditions using
expected conditions means that we're using these expected conditions not the
ones from here so whenever the ones from support that you I disappear our code is
going to be great and ready because if I hover over you can see that we're using
selenium extras that what wait helpers out expected conditions so now we are
all good so as I said although it's a problem for future code because you're
gonna need to do exactly what I did to fix it and just make sure that you use
this new get package to fix all of your future problems sadly I have no control
over this that's what the selenium developers decided to do so I just
wanted to make sure that you are aware because no one that I know has shown
this or shown how to fix these problems yet so I wanted to make sure that you're
one of the first to know how to fix these problems so that you don't
encounter them in the future