Archive

Archive for June, 2014

Code 19 Yellow Exclamation AVG miniport driver

Recently, I was asked to fix a Windows XP laptop where the internet connection was not working on either WiFi or wired connections. After checking device manager, I spotted yellow triangles on lots of Network Adapters. On clicking on these, I saw the message “Windows cannot start this hardware device because its configuration information (in the registry) is incomplete or damaged (code 19) ”

Then I noticed a pattern, all the failed network adapters were marked AVG miniport driver. So, my initial reaction was to uninstall AVG and reboot, but that didn’t h help. I couldn’t remove the failed network adapters either, so I checked the web, and found this procedure:

Windows Vista, Windows 7:
1. Open menu Start -> (Settings) -> Control Panel.
2. Double-click Network and Internet -> Network and Sharing Center.
3. In the left pane, click Change adapter settings.
4. Right-click the connection you are using and select Properties.
5. Under This connection uses the following items un-tick (clear) AVG network filter driver.
6. Click OK to store the changes.

Windows XP:
1. Open menu Start -> (Settings) -> Control Panel.
2. Double-click Network connections.
3. Right-click the connection you are using and select Properties.
4. Under This connection uses the following items un-tick (clear) AVG network filter driver.
5. Click OK to store the changes.

Which worked for me!

Categories: Uncategorized

Hello World with Selenium and C#

I decided to take a look at Selenium as a way to automate the Chrome Browser from .NET. You first need to download three bits of software, the Selenium server, – which you run from the command line, and the Selenium Bindings for c#, both from http://docs.seleniumhq.org/download/. Finally, you have to download the Chrome driver from http://chromedriver.storage.googleapis.com/index.html?path=2.9/ 

I created a console app, and referenced all the WebDriver DLL (selenium\net35\WebDriver.dll), added the using statements:

using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;

and, then declared a public static IWebDriver object

public static IWebDriver Driver = new ChromeDriver(@”C:\research\selenium\”);

The path, was pointing to my Chrome Driver (Win32)

I then started with a simple command in my Main() method to navigate to a URL:

Driver.Navigate().GoToUrl(“http://www.logitravel.co.uk/”);

After that, I wanted to execute some javascript, to fill in the form, and move to the next page, so I wrote this function:

static object ExecuteJavascript(string javascript)
{
object oResult = null;
var javaScriptExecutor = Driver as IJavaScriptExecutor;
if (javaScriptExecutor != null) oResult = javaScriptExecutor.ExecuteScript(javascript);
return oResult;
}

Then it’s just a matter of writing the chain of Javascript commands to navigate the website, and get the information I want, – everything’s synchronous, 

Driver.Navigate().GoToUrl(“http://www.logitravel.co.uk/”);
ExecuteJavascript(“document.getElementById(‘hidOrigenSV’).value=’Paris’;”);
ExecuteJavascript(“document.getElementById(‘hidDestinoSV’).value=’Dublin’;”);
ExecuteJavascript(“document.getElementById(‘origenSV’).value=’Paris’;”);
ExecuteJavascript(“document.getElementById(‘destinoSV’).value=’Dublin’;”);
ExecuteJavascript(“document.getElementById(‘datePickerIda’).value = ‘Sat, 7 June, 2014’;”);
ExecuteJavascript(“document.getElementById(‘datePickerVuelta’).value = ‘Sat, 14 June, 2014’;”);
ExecuteJavascript(“document.getElementById(‘btnFormAereoV2’).click();”);
var cheapestPrice = ExecuteJavascript(“return document.getElementById(‘agr_0’).getAttribute(‘data-value’);”);
Console.WriteLine(“Cheapest price:” + cheapestPrice);
Driver.Close();

 

Categories: Uncategorized