vid-automation selenium tests
[vid.git] / vid-automation / src / main / java / vid / automation / test / infra / Exists.java
index 14339d6..63327f5 100644 (file)
@@ -1,6 +1,8 @@
 package vid.automation.test.infra;
 
+import org.openqa.selenium.By;
 import org.openqa.selenium.NoSuchElementException;
+import org.openqa.selenium.WebElement;
 import vid.automation.test.Constants;
 
 public class Exists {
@@ -31,4 +33,12 @@ public class Exists {
             return false;
         }
     }
+
+    public static boolean tagNameInAnotherElement(WebElement parent, String tagName) {
+        try {
+            return parent.findElement(By.tagName(tagName)) != null;
+        } catch (NoSuchElementException exception) {
+            return false;
+        }
+    }
 }