Class RemoteEndpointFactory
Factory to create and access endpoints.
// 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);
public sealed class RemoteEndpointFactory
- Inheritance
-
RemoteEndpointFactory
- Inherited Members
Constructors
RemoteEndpointFactory()
public RemoteEndpointFactory()
Methods
GetAll()
Gets all existing endpoints.
public IEnumerable<IRemoteEndpoint> GetAll()
Returns
- IEnumerable<IRemoteEndpoint>
All existing endpoints.