Selenium Interview Questions & Answers by Tech Interviews
Author:Tech Interviews
Language: eng
Format: azw3
Published: 2017-08-25T07:00:00+00:00
Here are some of the commonly used mechanisms to handle data in automation:
Excel Data
It is the most popular data format used widely by automation testers. We can not only use it to store test cases but to keep test data as well.
This format is very flexible and supports CRUD (Create /Delete /Update /Delete) operations also. And almost all languages that integrate with Selenium like Java, Python, Ruby have ready-made libraries available to access and manipulate Excel data.
CSV Data
CSV stands for comma-separated values. It is the most simplistic way of organizing test data in tabular format. It represents a sequence of rows and columns (delimited by commas) stored in a text file with CSV as the file extension. Each row corresponds to a record whereas every column maps to a field.
It is trivial to access CSV data as most programming languages like Java and Python come with standard libraries to read/write text files. However, Excel does support this type of data and can handle it the same way as it does its own.
XML Data.
XML is an acronym for Extensible Markup Language. It generates documents in a format which is readable by both human and machine. XML is a web standard and tends to be faster than Excel when it comes to read/write data. And there are either built-in or third-party XML parsers available in Java, Python, and others to manage the data.
Sometimes both Excel and XML get used together in Selenium automation projects. For example, we can write the test cases in Excel and create a macro to convert them in XML format. The automation suite then reads the test cases from XML and executes them.
Also, XML comes with another unique feature to search specific elements called as XPath. It is a known Selenium term which we usually use to traverse the DOM of a web page. However, it works the same with any XML data or document.
JSON Data.
JSON is an acronym for JavaScript Object Notation. It supports a light-weight data interchange format. Since JSON data is compact and fast, it has become a preferred choice for supplying input in web services.
And we can also use it to represent the test data replacing Excel and XML formats. If the size of data is invariably large, then JSON would surely deliver better performance.
YAML Data.
YAML is another human-readable language for data serialization. It stands for YAML Ain’t Markup Language. This type of data format is ideal for holding configurations. However, it could be useful for various other purposes. It is a superset of JSON language and can store both JSON and XML data within itself.
Unlike other data formats, it allows referencing other elements inside YAML using anchors.
SQL Data.
Another type of data which doesn’t get used often is SQL data. It is highly customizable and enables fast data access. It can store both the test cases and any configuration or settings as required.
However, there is a separate database software like MySQL/MongoDB/SQL/Oracle needed to make it work. It is an additional overhead for the automation engineers to install the database software to prepare a new setup.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
A Swirl of Ocean by Melissa Sarno(50977)
The Book of Dreams (Saxon Series) by Severin Tim(33350)
Cecilia; Or, Memoirs of an Heiress — Volume 1 by Fanny Burney(32527)
Cecilia; Or, Memoirs of an Heiress — Volume 2 by Fanny Burney(31928)
Cecilia; Or, Memoirs of an Heiress — Volume 3 by Fanny Burney(31916)
Call Me by Your Name by André Aciman(20468)
Eleanor and Park by Rainbow Rowell(15430)
Always and Forever, Lara Jean by Jenny Han(14873)
For the Love of Europe by Rick Steves(13824)
Norse Mythology by Gaiman Neil(13317)
Crooked Kingdom: Book 2 (Six of Crows) by Bardugo Leigh(12292)
Shadow Children #03 - Among the Betrayed by Margaret Peterson Haddix(11906)
Among the Betrayed by Margaret Peterson Haddix(11593)
Twisted Palace by Erin Watt(11132)
Six of Crows by Leigh Bardugo(10161)
They Both Die at the End by Adam Silvera(9791)
P.S. I Still Love You by Jenny Han(9562)
Fangirl by Rainbow Rowell(9213)
Thirteen Reasons Why by Jay Asher(8874)