Author: <span>Aditya</span>

Using Excel for data driven testing with WebDriver and C#.

For data driven testing we need to create some kind of repository like excel or xml or any database to save our test data. XML is most popular one becuae accessing XML is quite easy and there are various dlls are easily available which we can download and start using if our data is not that complex. In some case where we need to customize our test data in excels file. I tried to write a simple code using C# and read data in excel. follwing table is a sample data sheet in Excel. Excel DataFile: Name: TestDataFile.xlsx There are three …

Webdriver and Image Verification

Can you do image verification if it loaded on webpage?  Yes! You can verify but you cannot say that images are half loaded. To verify if an image is correct then there would be some other method but the code will tell you just that images are loaded on the page or not. You can send HTTP request to that source using GET method and check the status code as 200. if that the case then your image downloaded properly and an image is there.  [gist id=6244519] Please drop your comments if you think if I am missing anything. If you …

JavaScript Alerts and Selenium/Webdriver.

One of the most popular question among selenium/Webdriver users. I used that couple of places to handle. Selenium RC: if you are expecting javaScript alert and  you want to handle using OK then use following commands and then you can use your code. selenium.chooseCancelOnNextConfirmation() selenium.chooseOkOnNextConfirmation() Note: In Firefox 4.0 and higher version, you will see alerts like following and its impossible to handle this via selenium. There is a workaround to handle this. Type ‘about:config’ in Address bar of firefox browser and accept the warning. Type “tab_”. You will see prompts.tab_model.enabled option with Value: true. Double click on the row which will …