Slowly Trying To Learn How To Write Automated Checks With Javascript

If I were to treat the experience like a game, the difficulty level I felt when learning how to write automated checks with Java is normal. At the time, the choice of programming language was obvious – I still remembered how to write C++ functions and if-else conditions and loops from back in college so I thought that maybe I could ease through the course materials that I took. By then I also had practical knowledge about Selenium using the Firefox record-and-play extension, or at least I understood how valid page element locators and Selenese commands are composed. What I focused more then was understanding how I could customize, update, and maintain checks in code rather than by updating all Selenium IDE tests via the browser extension, since the latter was a huge pain. Along the way the way I learned other stuff – object-oriented programming, version control, virtual machines, Selenium Grid, and parallel testing.

Then a year later I decided to rewrite the existing test code to a Ruby implementation, coupled with gem libraries like watir and page-object. There were no actual massive reason as to why I decided to try another programming language, except that I was curious. Ruby sounded cool, there were many who thought of the language as programmer-friendly, and when I found out about Jeff Morgan‘s Cucumber and Cheese book online I finally gave in and studied. And I realized, after writing test code in Ruby for a few months, that the difficulty level was easy. Perhaps because I’ve already absorbed a lot from programming in Java, or perhaps because I’ve found out (and was amazed) that Ruby code in general is more readable. The learning process was tons of fun – aside from spotting mistakes in my earlier style of writing code with Java and became more informed about refactoring, I also got knowledgeable about writing API tests, even HTTP requests, and understood that there are ways of testing web applications without directly interacting with the user interface.

Now I’m reading Enrique Amodeo’s Learning Behavior-Driven Development with Javascript book and studying how to write automated checks using Javascript. The difficulty level is hard, even with all the experience I’ve gained with previous programming languages, and I say that it’s all because of the language syntax. If I didn’t know any other programming language, I would probably come out and say that the difficulty level is insane. From what I’ve experienced so far, the abundance of braces, nested functions, callbacks, and promises makes it difficult for me to read and debug, and I feel that there’s a lot of room for making mistakes. Writing test code in Javascript is a bit overwhelming. So learning is slow, and a lot of the time I have to back-read and study how the code was written some more before going forward to the next lesson. But it’s all good practice for mastering the language and it’s quirks, which may prove useful someday.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.