コード例 #1
0
 internal static void  DeviceStatusInformation(this ILogger logger, DeviceStatusSummary summary)
 {
     logger.Information($"Device: {summary.Device}");
     logger.Information($"Status: {summary.Status}");
     logger.Information($"Device Name: {summary.DeviceName}");
     logger.Information($"IP Address: {summary.IPAddress}");
     logger.Information($"MAC Address: {summary.MacAddress}");
     logger.Information($"Connection Type: {summary.ConnectionType}");
 }
コード例 #2
0
        public static DeviceStatusSummary GetDeviceSummary(this FirefoxDriver driver, Device device, out string xpathCheckbox)
        {
            var macAddress  = device.MacAddress();
            var xpathDevice = $"//tr[td/span/text()='{macAddress}']";

            xpathCheckbox = $"{xpathDevice}/td[1]/input";

            var statusElement         = driver.FindElementByXPath($"{xpathDevice}/td[2]");
            var deviceNameElement     = driver.FindElementByXPath($"{xpathDevice}/td[3]");
            var ipAddressElement      = driver.FindElementByXPath($"{xpathDevice}/td[4]");
            var macAddressElement     = driver.FindElementByXPath($"{xpathDevice}/td[5]");
            var connectionTypeElement = driver.FindElementByXPath($"{xpathDevice}/td[6]");
            var summary = new DeviceStatusSummary
            {
                Device         = device,
                Status         = statusElement.Text,
                DeviceName     = deviceNameElement.Text,
                IPAddress      = ipAddressElement.Text,
                MacAddress     = macAddressElement.Text,
                ConnectionType = connectionTypeElement.Text
            };

            return(summary);
        }