Lesson Learned in Automation Testing
I was very much fascinated by Selenium WebDriver since quite a few months especially for the fact that one can build complete automation test framework for any web based application and no matter you love C# or you are a java guy like me, selenium supports almost all languages.
The real point is to have that automation mindset as well as analytical skills that are required to implement a framework, anyways, my experience started when I was given an opportunity to implement Selenium WebDriver in one of our applications, which is restricted to IE browser and give limited access of the browser to the user; as if user is working on a desktop application.
Now that being said, it wasn’t as easy as it seemed but I took it as a challenge and started structuring Selenium WebDriver project for it.
Setting up WebDriver on a PC is another thing (those who work on it can relate it :) ) but once it is set and working it will become a weapon for any quality assurance and test engineer.
So, I set up “Page Object” pattern and was able to open the link but problem that I faced was that the moment application link is opened in IE, it populates new login window to enter credential for the application.
I was unable to locate the main elements of that login screen of our application like username, password fields and I applied code for locating them not only through name but also from ID, CSS, and Xpath but still no luck.
What I found interesting is that the window that was opened by the initial application link was actually automatically closed the moment response was received by the App and new IE window was opened and that is why my code was not working because it was searching the elements on the first screen which was already closed by the App.
Then I found out that I would require to use couple of built-in methods like WinHandles () and Switchto() in order to switch control of Selenium WebDriver from initial window to the new login window. As soon as I wrote a working code for that, I could find my elements and successfully login to the application ..Yay....!!!
I had to do the same switching after login to the application so the strategy was applicable but yet it was cumbersome to maintain and implement as application was not Selenium friendly.
Therefore, Lesson learned were as below:
· Thoroughly investigate the application that you would like to make automation test suit for as we know every tool is like a weapon and has got its limitations too, so has the application under test.
· Always think out of the box and also think that there is no box at all, while working on making automation framework as you never know what you will face while implementing it as every application is unique.
· If maintaining your framework and creating test scripts would be much difficult due to lot of workaround (that are required) or application restrictions, then the questions should come up in your mind that are you using a right technique with your automation tool? Or is your application suitable to get automated and if yes then which automation tool will be a good choice.
· Lastly, you should be able to have some serious research skills to comprehend any full stops or badly-envisage scenarios.
Happy Automation testing…………………. :)
Global Talent Acquisition| End-to-End Recruitment | Talent Management | HR Operations | Performance Management | Mentoring
7 年Nice Stuff
Professor at TCU I Founder Sunbonn & CareerReady.AI
7 年Loved the article
Digital Transformation Expert | UX Strategist | Marketing | Product Management
7 年Good work, thanks