In this post I will explain how I implemented check that youtube video contains specific language subtitle.
As part of application acceptance test, I needed to implement UI check that confirms that selected youtube video contains selected subtitle language. Getting the value of youtube video available subtitles from youtube player would be hard (even not manageable) task. So I decided to use different approach.
I remembered that while “search videos by subtitle language” feature was developed, developers mentioned (in github issue conversation) that this feature will be based on youtube api. So why not use this same code in my automated check?
The risk is here that we are using api that could return different list of available subtitles than one that are obtained using youtube UI elements. But knowing that Google is very good at testing their product features, I labeled that risk as very low.
Here is cucumber step definition:
It is important to state that I found on this blog post how to get attribute value using watir-webdriver.
Always use your tools wisely. Do not force one way of achieving something if there is more elegant way.
In asynchronous world, before any interaction with page element, it is good practice to wait for that element to become visible.
Watir webdriver also has present wait methods, but that does not cover UnknownObjectException.
So, in order to tackle this problem, you need to write your UnknownObjectException handler, something like this:
In this post I will explain how simple change in testing environment influenced my testing of simple feature.
Feature is rather simple, tweet something interesting from the application. As this feature is tested, I was creating automated script for it. This feature is important for my client, so I decided that it should be part of regression testing suite.
I developed script for Chrome, and I also decided to check it using Firefox. Remember that in RIMGEA we learned that G stands for Generalize. We need to test our feature by changing the environment, in this case browser itself.
And in Firefox script failed! Why? Because Firefox tweet feature has one extra step in domain of twitter application.
It is clear that Firefox requires one extra button click. Since prior to that click, user clicks on “Log in and tweet” button, this is not consistent with that button. User expects that with one click he does two actions, log in to twitter and tweet that item.
With this post I amplified on real case how important is to vary your testing environment because in that way you could find interesting issues within the application.