InterviewSolution
| 1. |
What Types Of Data Have You Handled In Selenium For Automating Web Applications? |
|
Answer» Data is very important and critical information to run automation successfully. Data can be in different forms to serve different purposes. For example in automation, input data includes test cases, and it could be test data that feeds into test cases as parameters. Selenium supports Excel, CSV, XML, JSON, SQL, YAML data types for automation. 1. Excel Data. Excel is a popular data format used widely in automation. It can store test cases as well as test data. Excel format is not only flexible but also support Create/Delete/Update/Delete (CRUD) operations also. All language that Selenium supports have ready-made LIBRARIES to access and manipulate excel data. 2. XML Data. An XML document is in a format readable by both humans and machines. XML is a web standard and faster than Excel in reading or WRITING data. There are built-in or third-party XML parsers available to manage the data. XML has a unique feature to search specific elements called XPath. Xpath is a known term in Selenium which traverses the DOM of a web page. Many times Excel and XML are used together in Selenium automation projects. You can write the test cases in Excel and create a macro to convert them in XML format. The automation suite reads the test cases from XML and executes them. 3. SQL Data. SQL data is customizable and enables fast data access. It stores both the test cases and configuration or settings as required. Separate database software like MySQL/MongoDB/SQL/Oracle is required to make it work and install any of this software to prepare a new setup which is an additional overhead for the automation engineers. 4. CSV Data. CSV that is comma-separated-values, is the simplistic way of organizing test data in tabular format. CSV data is a text file with extension .csv and it represents a sequence of rows and columns delimited by commas. Every row of CSV file is a record while every column mapped to a field. As most programming LANGUAGES come with standard libraries to read/write text files it is trivial to access CSV. Excel supports this TYPE of data and can handle it the same way. 5. JSON Data. JSON (JavaScript Object Notation) supports a light-weight data interchange format. JSON data is compact and fast and we can use it to represent the test data replacing Excel and XML formats. For large data SIZE, JSON would deliver better performance. 6. YAML Data. YAML(YAML Ain’t Markup Language) is a human-readable language for data serialization. For holding configuration this type of data format is ideal. YAML is a superset of JSON language and stores both JSON and XML data within itself. |
|