How to verify the image height and width in Selenium

Its now easy to verify the image height and width of an image on a web page using Selenium. Here is the code that verifies if the height of the image is between 595 and 686 px and width is 230 px. decimal height = selenium.GetElementHeight(“//img[@class=’heroImageMain’]”); decimal width = selenium.GetElementWidth(“//img[@class=’heroImageMain’]”); Console.WriteLine(“Hero Image dimensions:- ” + […]

Using Array to execute Selenium commands in C#

Here is an example of how you could you an array to execute repetitive selenium commands like selenium.IsElementPresent or selenium.Click. string[] footerLinks = new string[] { link1, link2, link3, link4, link5, link6, link7, link8, link9}; foreach (string link in footerLinks) { selenium.Click(link); selenium.WaitForPageToLoad(“30000″); } Submitted by: Horgan Barry [ad#PostAD]

How to run Unit Tests From Network Drive

When loading a test project from a network drive, Visual Studio builds the projects fine, but when running the test project Visual Studio shows the error: “Error loading \\\XYZ\Main\XYZ.Framework.Test\bin\Debug\XYZ.Framework.Test.dll: Could not load file or assembly ‘file:///Z:\Projects\XYZ\Main\XYZ.Framework.Test\bin\Debug\XYZ.Framework.Test.dll’ or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)” in the output window and does […]