コード例 #1
0
 @Test
 public void testIsElementPresentTrue() throws WidgetException {
   wd.open(url);
   IElement e = new Element(button);
   Assert.assertTrue(
       "Test isElementPresent on an element that does exist returns true", e.isElementPresent());
 }
コード例 #2
0
 @Test
 public void testIsElementPresentFalse() throws WidgetException {
   wd.open(url);
   String test = "//button[@id='myButtonDoesntExist']";
   IElement e = new Element(test);
   Assert.assertFalse(
       "Test isElementPresent on an element that doesn't exist returns false",
       e.isElementPresent());
 }