use of org.wso2.iot.integration.ui.pages.samples.ConnectedCupDeviceViewPage in project product-iots by wso2.
the class DevicesPage method viewDevice.
/**
* This method performs the navigation to the Device view of the given device.
* Here the navigation happens to the Connected cup device.
* @param deviceName : Name of the device.
* @return : The corresponding device view page. Null if not visible.
*/
public ConnectedCupDeviceViewPage viewDevice(String deviceName) throws IOException {
WebElement deviceTable = driver.findElement(By.xpath(uiElementMapper.getElement("iot.devices.table.xpath")));
List<WebElement> anchors = deviceTable.findElements(By.cssSelector("a"));
for (WebElement element : anchors) {
String connectedCupLink = getLink(element, "/device/connectedcup?id=");
if (connectedCupLink != null) {
driver.get(connectedCupLink);
return new ConnectedCupDeviceViewPage(driver, deviceName);
}
}
return null;
}
Aggregations