A little while back I wrote a post on achieving concurrent or parallel test running with Selenium, Specflow and NUnit2, but what about NUnit3? Let's have a look at that, thankfully it is a bit simpler than running an external build script as done previously. First up, according to the Specflow docs - open up your AssemblyInfo.cs file in your project and add the following line: [cc lang="c#" widt...
This article briefly explains how to, or at lease how I interact with dropdown menus in C#. Generally speaking I try to pass through the identifier and the value to select to a helper method which carries out the task.
Lets have a look at a typical step definition, first we’re waiting for the element to appear on screen and then selecting the option by value.
public void WhenISelectTheOrganisation(string orgName)
So lets look at SelectFromDropDownByClass:
We’re creating a new instance of Webdrivers’ SelectElement and passing through the class name and text of the item in the dropdown, keeping the identifier variable ensures we can reuse the same method elsewhere in the solution, you can interact and select items in other ways from dropdowns and also use other identifiers as necessary such as Id, CssSeleector and XPath.