Tuesday, January 24, 2017

AUTOMATION 25 - Thinking about maintainability with methods

Today we're picking up again on the automation series of articles that I started last year. You might wish to refresh yourself with what we've covered by following this link.

Technical level: ***

Previously on this blog, I’ve taken you through some an introduction to Java, which has been about understanding and playing with some core features around using the language effectively. I chose Java because it’s popular, and my team uses it, but some of the concepts coming out about using methods, data hiding and objects are common to many languages.

Meanwhile, on the automation series, we took a look at several technologies, thinking about how they worked best … or not so well for checking.

In doing so, we’ve covered a lot of material, over 40 articles so far! And here’s where it starts to pay off, as we bring the two together for the remainder of the automation series!

I’ve held a whole load of interviews with people around Wellington to talk about their automation, where people are now, and what “came before this”. What’s a common story is that initially it’s been seen that they wanted testers to write automation scripts, and their testers weren’t very good at coding. So they’ve ended up picking tools like Selenium IDE or Coded UI.

These kinds of record and playback tools can have their advantages if used well, but they’re rather clunky. Typically they use a very simplistic language, which doesn’t allow for loops, ifs, methods or any other features of a programmable language.

So you end up with long scripts, with no real brains to them – you don’t benefit from any kind of code reuse, so everything’s written out long hand.

So you write out 100 scripts this way, and the first few steps of each one is to log in. Then your project changes … there’s a decision to scrap the current login page, and use Facebook to provide your login service. The developers say this isn't too big a change – but it won’t be quick for your automation. You will need to find a change that works, and then copy and paste it into a 100 test scripts.

I like to say that in such scenarios we've taken on (without realising it) a kind of test automation debt, one that because of the limitation of our tool, we can never pay off. Some of this will feel a bit deja vu because we talked about it here under our denial in testing series.

This is where the power of computer languages come into their own and why Selenium Webdriver (over IDE) has really come into it’s own. As we've covered, Selenium Webdriver is driven by a fully structured language like Java.

Using WebDriver and a language like Java, you can define your steps to login as a method, and have all your 100 test scenarios call that method.

Now when the login changes, you change the login method, and the change ripples down to all the tests that use it. This is the heart of building maintainable code, using the features of your programming language to reduce your overhead.

Don’t define something twice, when you can extract it as a method and use it over multiple tests. We looked at how methods help us to avoid tangled code during our Java series here.

Next time we'll consider some design patterns which can be used with tools like Selenium WebDriver.

I want to share the story to you that I am HERAWATI MOTHER a TKW from malaysia and accidentally I open internet and I see DARNA MOTHER comment from singapur about AKI SYHE MAULANA who has helped him become successful and finally I also tried to contact him and alhamdulillah he Want to help me to give the number Togel/lottrey toto 4D dr ritual results / unseen and alhamdulillah it really proved translucent and won RM.230.000 Ringgit, now I am back indon buying house and train although sy Just a housemaid at selangor malaysia, sy very thankful To AKI SYHE MAULANA and do not forget to give thanks to ALLAH because through AKI MAULANA I also can be as successful as this.So kawan2 who in distress jg ever break down, when it's time god must be the road of origin you want to try, this is the true story of a migrant worker, AKI MAULANA is a famous spiritual teacher in Indonesia. If you want to like me visit the website CLICK HERE RITUAL GHAIB TEMBUS LOTTREY

This blog is having the general information. Got a creative work and this is very different one.We have to develop our creativity mind.This blog helps for this. Thank you for this blog. This is very interesting and useful...

IBCbet Website to Present Luck To risk the world wide. Betting Markets World wide betting opportunities Online casino games are fun activities that are fun to have a habit. The new desire to win the chance to create a good view. The opening of the financial path created is excellent. Meet new betting games. A way to play a game that brings you to the overwhelming victory. Meet the ultimate gambling luck. Open the path of fun. Online casino games, casinos, slots, slots and many other leading sports are one of the online gambling sites that open the path to happiness. With many casinos are known to be excellent. Relaxing game opens the path of finance to the perfect. Choosing an alternative to gambling that is fun every day. Open your eyes to the gambling industry. Join the fun. With more than 200 games to choose from more fun games with special discounts for you to play with. Bet on the web. Sbobet

The most popular online casino access.Gclub Slot Online casino site is a site that is famous for the game of online gambling is open for a long time. It is popular with gamblers who are expert insurers from participating in the fun. And to use more and more each day. In addition to the game has a lot. In this time, our online casino has evolved from a team of qualified programmers. To mimic the atmosphere and precedent of all online gambling games. From overseas casinos Come on website. That makes the gambler or anyone interested in you easily accessible. No need to download the program. Or simply do not need to install any time to come to our website from a smartphone or tablet computer that can connect to the Internet. You can join us. The subscription process is straightforward. The team will take care of you all the time. It is advisable. And help Answer all questions If you want to have fun with us. Think of us online casino. We will not disappoint you. Contact us at the website. Holiday Palace

About Me

I am a tester & critical thinker. This blog is where I write about and explore the things that matter to me, in all their weird and wonderful forms ...
The views inside are my own, and don't represent those of any company I've worked for.