Sunday 20 July 2014

QA girl is hungry!!!

I wanted to eat Salad, I went to McDonald's site and I didn’t find anything relevant on the screen for my need directly, I had to go to FOOD section and viola :-) I can see my ‘Salads’ under submenu
So, its not a normal action which can be performed directly with any webdriver command we have learnt yet, (when I hover over FOOD, another sub menu opens and then I have to choose Salads )
so its mouseHover /mouseOver on FOOD -> move to Salads and click on it.
Ok….... I get it, but how I do I do that!!!
Its simple : just moveToIt→ action → build it or perform it


Yeppie!! I can order my favorite salad now
You must also try cheese sandwich, its so good ;-)


My Mistake: I Had this script ready for test booking of any eatable from McD. But the day, when I wanted to show it to my colleague it didn't work and put me in embarrassment.

What did I learn From it:
Actions class action may not work on every browser version. This test works fine with FF17, FF27 and I didn't disable my browser's auto upgrade an the day I was showing it and it got updated to FF 24 and bang!!! So make sure, you don't upgrade your browser mistakenly which you are using for test automation because with the latest browser the webdriver library may or may not be compatible. --> You can disable auto updation of a browser by un-checking Automating install updates option under browser's tools/preferences-->Advance tab
Note:With some of the browsers it happens that once mouse hover action is performed, the menu list disappears with in a fraction of second, even before Selenium identifies the next submenu item. In that situation it is better to use ‘perform()’ action on the main menu to hold the menu list till the time Selenium identifies the sub menu item.

Also, it is suggested to create your own profile and use the same for your selenium tests instead of letting the webdriver to create any profile for you. We will come to Profiling in Selenium in the next blog.
Hope this post served your purpose, let me know if I can customize it for making it more valuable for your need, please do drop your comments
Happy Learning :-)

No comments:

Post a Comment

Memories from Conference of the year

Another happy day:-) Got the opportunity to meet & chat with the amazing people around the globe. The brilliant minds behind the inven...