
We are going to use JXL’s Excel as our Data provider to read data from external data sources. However, for now, let’s consider JXL as an API to read and write data from Excel Sheets. You can read more about JXL from the site.

Here we are going to talk about driving data from Excel sheets using JXL (JAVA EXCEL API). Now if your application becomes very complex and you rely on each and every data to be driven from external data sources, then you SHOULD use data sources like Excel, Database table, etc.
READ DATE FROM EXCEL IN JAVA JXL CODE
Sample code to read data from Sample file in JAVA public void ReadProperty() throws IOException When to do data driven testing in Selenium from Excel Sheet? Well, the answer is both Yes and No! Depending upon the complexity of your application, if your application has very few objects and their properties to be identified are very minimal, you can use “ Property file” instead. Do we still need to use the data sources you are talking about? What are the limitations of Selenium IDEīut wait, what if we just need to store some of the application properties like Object Name, Application Window name, global properties, etc. This is because Selenium IDE itself has a lot of limitations as shown below. Note that all these operations are going to be done with Selenium Core (JAR). However, in this post, we are specifically going to discuss getting data from the excel sheet. So let us understand the Data-driven testing In Selenium. We also face this issue during framework development, which is getting data from external sources (data-driven testing). In this article, we would like to write one of the most common scenarios which we encounter while working with Selenium. This code is flexible and easy to maintain and therefore adds value when large volumes of random test data are necessary.

That said, for repeated scenarios, testers can keep the same data set while just altering the functionality-specific code.Testers can save time and also reduce the cost of supplementing new test data every time. Thereby ending up in the creation of unique data sets with parameters for different scenarios.So, modifications in test scripts do not affect the test data. Selenium Automation Testing enables testers to separate logic in test scripts from test data.
