Test Automation

Apart from Technical Topics, increasingly i find myself wanting to write about other topics that interests me - Entreprenuership and Business, Leadership, Africa, Service Industry (e.g Hotels, Restaurant). My writings would always represent my opinions and it might change from time to time.

Use selenium to create screenshot

I just stunbled across selenium as a tool to take screenshot. Thuis could be useful for anything. In my case i used it to take the screenshot of a page just before it throws an error in my selenium test. and that i could have a look and investigate what the problem might have been. very simple command and the great thing is it can be easily used for screenshots of a page across different browsers.

Selenium and Javascript events

Have you ver been in situattion when you have typed a value into a text box and you expect a Javascript event to be triggered such as “OnBlur” Well selenium has a method “FireEvent” which triggers the event for you, but then the trick is you have to strip the “on” and name for the event wouldbe “OnBlur” I guess abit of example would make more sense, lol. This is what my html look like