You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support Finding of Multiple elements from ShadowRoot (#125)
* Support Finding of Multiple elements from ShadowRoot
- add JavaScript to generate CSS selector from element
- try to generate CSS selector if XPath generation fails - necessary for ShadowRoot elements since XPath doesn't work for them
Related to aquality-automation/aquality-selenium-dotnet#235
* Update ElementFactory to use generate CSS locator logic in generateLocator method instead of generateXPathLocator
Assert.assertTrue(elementLabels.size() > 1, "Should be possible to find multiple elements hidden under the shadow");
39
+
Assert.assertTrue(elementLabels.get(0).getLocator() instanceofBy.ByCssSelector, "Unique locator of correct type should be generated");
40
+
Assert.assertEquals(elementLabels.get(0).getElement().getTagName(), "div", "Should be possible to work with one of found elements");
41
+
Assert.assertEquals(form.getMainContainerLabels().get(0).getElement().getTagName(), "div", "Should be possible to work with one of found elements found by id");
42
+
}
43
+
28
44
@Test
29
45
publicvoidtestExpandShadowRootViaJs() {
30
46
Assert.assertNotNull(form.expandShadowRootViaJs(), "Should be possible to expand shadow root and get Selenium native ShadowRoot object");
31
47
Assert.assertNotNull(form.getDownloadsToolbarLabelFromJs().getElement(), "Should be possible do get the element hidden under the shadow");
Assert.assertTrue(elementLabels.size() > 1, "Should be possible to find multiple elements hidden under the shadow");
50
+
Assert.assertTrue(elementLabels.get(0).getLocator() instanceofBy.ByCssSelector, "Unique locator of correct type should be generated");
51
+
Assert.assertEquals(elementLabels.get(0).getElement().getTagName(), "div", "Should be possible to work with one of found elements");
52
+
Assert.assertEquals(form.getMainContainerLabelsFromJs().get(0).getElement().getTagName(), "div", "Should be possible to work with one of found elements found by id");
0 commit comments