RemoteEndpointFactory Class |
// 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");
// 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);
Namespace: Ranorex.Core
The RemoteEndpointFactory type exposes the following members.
| Name | Description | |
|---|---|---|
| RemoteEndpointFactory | Initializes a new instance of the RemoteEndpointFactory class |
| Name | Description | |
|---|---|---|
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
| Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
| GetAll |
Gets all existing endpoints.
| |
| GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
| ToString | Returns a string that represents the current object. (Inherited from Object.) |
| Name | Description | |
|---|---|---|
| CreateMobileEndpoint |
Creates a new Mobile endpoint.
Override for session time endpoint with same name.
Changes root to localhost if endpoint is root.
(Defined by RemoteEndpointFactoryExtensions.) | |
| CreateTransientWebDriverEndpoint |
Creates a new WebDriver endpoint.
This endpoint exists for the current automation session and will not be persisted.
(Defined by RemoteEndpointFactoryExtensions.) | |
| GetAllMobileEndpoints | Overloaded.
Gets all existing endpoints.
(Defined by RemoteEndpointFactoryExtensions.) | |
| GetAllMobileEndpoints(String) | Overloaded. (Defined by RemoteEndpointFactoryExtensions.) | |
| GetAllWebDriverEndpoints |
Gets all existing WebDriver endpoints.
(Defined by RemoteEndpointFactoryExtensions.) |