Hi all,
after I've watched the webinar about integrating Selenium into Ranorex, I tried the same thing as being shown in the webinar:
Code: Select all
using OpenQA.Selenium;
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Drawing;
using System.Threading;
using WinForms = System.Windows.Forms;
using Ranorex;
using Ranorex.Core;
using Ranorex.Core.Testing;
namespace SeleniumWebDriverExample
{
/// <summary>
/// Description of SeleniumCode.
/// </summary>
[TestModule("250606FA-C3C6-423B-9A79-112C83FD2EDC", ModuleType.UserCode, 1)]
public class SeleniumCode : ITestModule
{
/// <summary>
/// Constructs a new instance.
/// </summary>
public SeleniumCode()
{
// Do not delete - a parameterless constructor is required!
}
/// <summary>
/// Performs the playback of actions in this module.
/// </summary>
/// <remarks>You should not call this method directl instead pass the module
/// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method
/// that will in turn invoke this method.</remarks>
void ITestModule.Run()
{
Mouse.DefaultMoveTime = 300;
Keyboard.DefaultKeyPressTime = 100;
Delay.SpeedFactor = 1.0;
var webDriverEndpoint = Host.Local.TryGetAsWebDriverEndpoint();
if(webDriverEndpoint == null)
{
throw new InvalidOperationException("Endpoint not found!");
}
var existingDriver = webDriverEndpoint.WebDrivers.Single(wd => wd.Title.startsWith("Ranorex"));
}
}
}
Code: Select all
'System.Collections.Generic.IEnumerable<OpenQA.Selenium.IWebDriver>' does not contain a definition for 'Single' and no extension method 'Single' accepting a first argument of type 'System.Collections.Generic.IEnumerable<OpenQA.Selenium.IWebDriver>' could be found (are you missing a using directive or an assembly reference?) (CS1061) - C:\Users\nk.maiman80\Documents\Ranorex\RanorexStudio Projects\SeleniumWebDriverExample\SeleniumWebDriverExample\SeleniumCode.cs:57,63