@Test(expectedExceptions = { RuntimeException.class }) public void selectAnInvalidTab() throws Throwable { IJavaElement tabbedPane = driver.findElementByTagName("tabbed-pane"); AssertJUnit.assertEquals("0", tabbedPane.getAttribute("selectedIndex")); marathon_select(tabbedPane, "Tab 21"); AssertJUnit.assertEquals("1", tabbedPane.getAttribute("selectedIndex")); }
@Override public boolean marathon_select(String tab) { int tabIndex = findTabIndex((JTabbedPane) component, tab); if (tabIndex != -1) { ((JTabbedPane) component).setSelectedIndex(tabIndex); } return tabIndex != -1; }
JTabbedPaneJavaElement extends AbstractJavaElement { @Override public boolean marathon_select(String tab) { int tabIndex = findTabIndex((JTabbedPane) component, tab); if (tabIndex != -1) { ((JTabbedPane) component).setSelectedIndex(tabIndex); } return tabIndex != -1; } }
JTabbedPaneJavaElement extends AbstractJavaElement { @Override public boolean marathon_select(String tab) { int tabIndex = findTabIndex((JTabbedPane) component, tab); if (tabIndex != -1) { ((JTabbedPane) component).setSelectedIndex(tabIndex); } return tabIndex != -1; } JTabbedPaneJavaElement(Component component, IJavaAgent driver, JWindow window); }
JTabbedPaneJavaElement extends AbstractJavaElement { @Override public boolean marathon_select(String tab) { int tabIndex = findTabIndex((JTabbedPane) component, tab); if (tabIndex != -1) { ((JTabbedPane) component).setSelectedIndex(tabIndex); } return tabIndex != -1; } JTabbedPaneJavaElement(Component component, IJavaAgent driver, JWindow window); @Override String _getText(); static String getSelectedItemText(JTabbedPane component); @Override List<IJavaElement> getByPseudoElement(String selector, Object[] params); @Override boolean marathon_select(String tab); String getContent(); static String[][] getContent(JTabbedPane component); }
JTabbedPaneJavaElement extends AbstractJavaElement { @Override public boolean marathon_select(String tab) { int tabIndex = findTabIndex((JTabbedPane) component, tab); if (tabIndex != -1) { ((JTabbedPane) component).setSelectedIndex(tabIndex); } return tabIndex != -1; } JTabbedPaneJavaElement(Component component, IJavaAgent driver, JWindow window); @Override String _getText(); static String getSelectedItemText(JTabbedPane component); @Override List<IJavaElement> getByPseudoElement(String selector, Object[] params); @Override boolean marathon_select(String tab); String getContent(); static String[][] getContent(JTabbedPane component); static final Logger LOGGER; }