Click or drag to resize
Ranorex

RemoteEndpointFactory Class

Factory to create and access endpoints.
Examples
Example to create and use WebDriver endpoints in code.
// Create endpoint management factory
var fac = new RemoteEndpointFactory();

// Use existing endpoints
var existing = fac.GetAll();
Report.Log(ReportLevel.Info, string.Format("Endpoints: {0}", existing.Count()));

foreach (var e in existing)
{
    Report.Log(ReportLevel.Info, string.Format("Name: {0}", e.DisplayName));
}

// Get WebDriver endpoints form the existing ones (no equivalent for mobile currently)
var webDriverEndpoints = fac.GetAllWebDriverEndpoints();
Report.Log(ReportLevel.Info, string.Format("There are '{0}' WebDriver endpoints", webDriverEndpoints.Count()));

// Create user process endpoint
var ep = fac.CreateTransientWebDriverEndpoint(new WebDriverEndpointInfo("tempEp", "http://localhost:4444/wd/hub"));

var cfg = WebDriverConfiguration.FromJson("{}");
cfg.Name = "MyConfig1";
cfg.Description = "Code sample Config";

ep.ActivateConfiguration(cfg);

ep.ConnectAsync()
    .ContinueWith(_ => ep.MakeCurrentHostAsync())
    .Wait();

var b = ep.StartBrowser("firefox", "http://www.ranorex.com");
Example to create and use Mobile endpoints in code.
// Create endpoint management factory
var fac = new RemoteEndpointFactory();

// Create mobile endpoint in that way
MobileEndpointInfo info = new MobileEndpointInfo("ExampleEndpointName", "Android", "USB", "4100331a96f1a000");
// or MobileEndpointInfo info = new MobileEndpointInfo("ExampleEndpointName", "Ios", "WLAN", "192.168.1.13");
// or MobileEndpointInfo info = new MobileEndpointInfo("ExampleEndpointName", "Android", "Emulator", "emulator-5554");
var ep = fac.CreateMobileEndpoint(info);

// Use it like other endpoints
Host.MakeCurrentHost("ExampleEndpointName");
Host.Local.RunMobileApp("ExampleEndpointName", "ranorex.RxBrowser", true);
Inheritance Hierarchy
SystemObject
  Ranorex.CoreRemoteEndpointFactory

Namespace:  Ranorex.Core
Assembly:  Ranorex.Core (in Ranorex.Core.dll) Version: 12.7.4-git.38314c06
Syntax
public sealed class RemoteEndpointFactory

The RemoteEndpointFactory type exposes the following members.

Constructors
  NameDescription
Public methodRemoteEndpointFactory
Initializes a new instance of the RemoteEndpointFactory class
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetAll
Gets all existing endpoints.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Extension Methods
  NameDescription
Public Extension MethodCreateMobileEndpoint
Creates a new Mobile endpoint. Override for session time endpoint with same name. Changes root to localhost if endpoint is root.
(Defined by RemoteEndpointFactoryExtensions.)
Public Extension MethodCreateTransientWebDriverEndpoint
Creates a new WebDriver endpoint. This endpoint exists for the current automation session and will not be persisted.
(Defined by RemoteEndpointFactoryExtensions.)
Public Extension MethodGetAllMobileEndpointsOverloaded.
Gets all existing endpoints.
(Defined by RemoteEndpointFactoryExtensions.)
Public Extension MethodGetAllMobileEndpoints(String)Overloaded. (Defined by RemoteEndpointFactoryExtensions.)
Public Extension MethodGetAllWebDriverEndpoints
Gets all existing WebDriver endpoints.
(Defined by RemoteEndpointFactoryExtensions.)
Top
See Also