Thursday, February 09, 2012

Clearing all event logs

Here is the code to clean up all event logs in the current machine/server.

The code is in power shell, as some people feel this is the best language to write scripts on Windows.

strComputer = "." 
Set oWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,(Security)}!\\" & _
strComputer & "\root\cimv2" )
Set cLogFiles = oWMIService.ExecQuery _
("SELECT * FROM Win32_NTEventLogFile" )
For Each oLogfile in cLogFiles
Wscript.echo("Clearing Logfile " + oLogFile.Name)

Thursday, February 02, 2012

Web driver script

Hasan from Trainline shared with us Selenium WebDriver script.

I was using Selenium before Web Driver came into the picture. Need to try this out.


using System;

using NUnit.Framework;

using OpenQA.Selenium;

using OpenQA.Selenium.IE;

using OpenQA.Selenium.Remote;

using OpenQA.Selenium.Support.UI;

namespace WebDriver



class TrainlineTest



public void webDriverTest()


var ieCapabilities = DesiredCapabilities.InternetExplorer();

            ieCapabilities.SetCapability(InternetExplorerDriver.IntroduceInstabilityByIgnoringProtectedModeSettings, true);

var driver = new InternetExplorerDriver(ieCapabilities);






new SelectElement(driver.FindElement(By.Id("AdultsTravelling"))).SelectByText("2");

IWebElement query = driver.FindElement(By.Id("outwardDate"));

            query.SendKeys(Keys.Control + "a");



Assert.IsTrue(driver.FindElement(By.Id("showTicketsIdButton")).Displayed, "Show Prices Button Not Present");




Wednesday, January 11, 2012

The best file search utility–fast and free

I have come across Agent Ransack and it was really fast. Works well if you want to search for text inside a particular file.

Initial screen

Agent Ransack - great software for searching for text in files

Searching for the text “sync tool is run”.

sync tool is run

Visual Studio 2008 Load Test Gotchas!


I really like this link:

This was shared by our NFT SME.