Skip to content
David Luu edited this page May 26, 2018 · 1 revision

Selenium Excel AddIn

This project is data-driven test automation of Web applications using Excel. "Selenium and WebDriver" Implementation for the Excel Add-ins.

TestCase Sample Files

Features

  • Excel add-in implementation
  • Excel 2010 and 2013 support
  • Import TestCase File(*.html) form Selenium IDE
  • Very easy Data-Driven Test Automation
  • Automatic recording of evidence
  • IE, Firefox and Chrome support
  • COM Automation support. The available functions of the "Selenium Excel Addin" from any language.

Message for developers contributions are welcome, specially fixing bugs, documenting, applying patches and suggesting new features.

COM Automation

addin execute command see SeleniumExcelAddIn/ActionId.cs

JavaScript (JScript on WSH)

The type on the Windows Command Prompt

cscript automation.js

automation.js

var excel = new ActiveXObject('Excel.Application');
excel.Visible = true;

var addin = excel.ComAddins('SeleniumExcelAddin').Object
WScript.Echo('SeleniumExcelAddin version = ' + addin.Version);

var shell = new ActiveXObject('WScript.Shell');
var filename = shell.CurrentDirectory + '\\selenium-excel-addin-sample.xlsx';

excel.Workbooks.Open(filename);

addin.Execute('WebDriverInternetExplorer');
addin.Execute('Run');

excel.ActiveWorkbook.Save();
excel.Quit();

Python

import win32com.client
import os, sys
import logging

logger = logging.getLogger()
logger.level = logging.DEBUG
logger.addHandler(logging.StreamHandler(sys.stdout))

excel = win32com.client.Dispatch("Excel.Application")
excel.Visible = True

addin = excel.ComAddins("SeleniumExcelAddIn").Object
logger.info("SeleniumExcelAddIn version = %s" % addin.Version)

filename = os.path.join(os.getcwd(), "selenium-excel-addin-sample.xlsx")
logger.info(filename)

excel.Workbooks.Open(filename)
addin.Execute('WebDriverFirefox')
addin.Execute("Run")
excel.ActiveWorkbook.Save()
excel.Quit()

Clone this wiki locally