CSV TO JSON Conversion using Javascript Use the below code and then use command "node filename.js", this would generate a JSO...



CSV TO JSON Conversion using Javascript

Use the below code and then use command "node filename.js", this would generate a JSON file which is converted from CSV.

Install this library  before using the below script
npm i --save csvtojson

const csvtojson = require('csvtojson')

const fs = require('fs')

 

const csvfilepath = "./CustomerData.csv"

 

csvtojson()

.fromFile(csvfilepath)

.then((json) => {

    console.log(json)

 

    fs.writeFileSync("./cypress/fixtures/output.json",JSON.stringify(json),"utf-8",(err) => {

        if(err) console.log(err)

    })

})

 

Excel Helper for Selenium Data Driven Testing using C# Easily plug this helper class to your framework and start consuming it Note: This ...


Excel Helper for Selenium Data Driven Testing using C#

Easily plug this helper class to your framework and start consuming it

Note: This will not support .Net Core Framework and its only for .Net Frameworks, so if in case you are having trouble in reading the values check your .Net Framework.

Please install Microsoft Office Interop Excel from Manage Nuget before starting





Use the below name space as part of class

using Excel = Microsoft.Office.Interop.Excel;


public void ExcelHelper(string fileName)

        {

            object misval = System.Reflection.Missing.Value;

 

            Excel.Application excelApp = new Excel.Application();

            if (excelApp != null)

            {

                Excel.Workbook excelWorkbook = excelApp.Workbooks.Open(fileName, misval, misval, misval, misval, misval, misval, misval, misval, misval, misval, misval, misval);

                Excel.Worksheet excelWorksheet = (Excel.Worksheet)excelWorkbook.Sheets[1];

 

                Excel.Range excelRange = excelWorksheet.UsedRange;

                int rowCount = excelRange.Rows.Count;

                int colCount = excelRange.Columns.Count;

 

                for (int i = 1; i <= rowCount; i++)

                {

                    for (int j = 1; j <= colCount; j++)

                    {

                        Excel.Range range = (excelWorksheet.Cells[i, 1] as Excel.Range);

                        string cellValue = range.Value.ToString();

                        Console.WriteLine(cellValue);

 

                        //do anything

                    }

                }

 

                excelWorkbook.Close();

                excelApp.Quit();

            }

        }






Encapsulation in C#


Encapsulation in C#

Abstraction -  Using Interface


Abstraction -  Using Interface

Abstraction -  Using Abstract Class


Abstraction -  Using Abstract Class

Abstraction - Abstraction in C#


Abstraction - Abstraction in C#

Jenkins Installation on Windows 10 - Generic Java Package .war Supports opening browser and executing tests without any additional confi...


Jenkins Installation on Windows 10 - Generic Java Package .war
Supports opening browser and executing tests without any additional configuration

Selenium + Jenkins,Could not start Browser, but it works locally - Issue resolved


Selenium + Jenkins,Could not start Browser, but it works locally - Issue resolved

Environment Variables - System and User specific - Add , Edit and Delete


Environment Variables - System and User specific - Add , Edit and Delete

Installing - Java SE Development Kit 8   Note - Please follow the same steps to install any version by downloading appropriate version fi...


Installing - Java SE Development Kit 8 


Note - Please follow the same steps to install any version by downloading appropriate version file from below URL . This version 8 is very much compatible with Jenkins and most of the tools in market.

Step 1 - Go to the URL 


Step 2 -  Scroll Down and click on  - Windows x64


Step 3 -  Accept the Oracle Agreement , by clicking on the checkbox and click on Download Button.


Step 4 - It will Navigate to Login Page - Click on Create Account if you don't have an account and create one, if you already have one, Login to it using credentials


Step 5 - Download should happen automatically , else click on Download button again using the below link by accepting the agreement

Step 6 - Double click on the file downloaded



Step 7 - Installation Wizard will open follow the steps as highlighted - click Next Button



Step 8  -  Select Development Tools  - click Next button


Step 9 - Installation will begin


Step 10 - Destination Folder - By default it will be installed in C:\Program Files\Java\ 
If you want to change click on "change" button and select the path to install.
- Recommend you to leave it to default location chosen by application. - click Next Button



Step 11 - Installation Completed 
Java SE Development Kit 8 Update 261 [64-bit) - Complete  - click Close Button


Step 12 - Open windows command prompt and type command java -version  and press enter
Java version 1.8.0_261 should be displayed, which confirms Java is successfully installed in your Windows 10 Operation System.