Created
October 30, 2013 16:08
-
-
Save anonymous/7235319 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public boolean isElementPresent(By by, int indexx) { | |
| //driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS); | |
| try { | |
| driver.findElements(by).get(indexx); | |
| return true; | |
| } catch (NoSuchElementException e) { | |
| return false; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 | |
| at java.util.ArrayList.rangeCheck(ArrayList.java:604) | |
| at java.util.ArrayList.get(ArrayList.java:382) | |
| at com.codes.lpa.application.BaseApplicationService.isElementPresent(BaseApplicationService.java:69) | |
| at com.codes.lpa.objects.Attorney.testReadContactPageFields(Attorney.java:52) | |
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) | |
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) | |
| at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99) | |
| at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81) | |
| at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) | |
| at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75) | |
| at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45) | |
| at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71) | |
| at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35) | |
| at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42) | |
| at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) | |
| at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52) | |
| at org.junit.runner.JUnitCore.run(JUnitCore.java:121) | |
| at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:77) | |
| at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195) | |
| at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) | |
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) | |
| at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) | |
| at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195) | |
| at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) | |
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) | |
| at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| baseProfile.profileIndIDSearch(expectedProfileData.getRoleUuid()); | |
| if(baseProfile.isElementPresent(By.cssSelector("td > a"), 1)) { | |
| System.out.println("search results found: " + expectedProfileData.getRoleUuid()); | |
| baseProfile.searchRowOneNameCell().click(); | |
| } | |
| else { | |
| System.out.println("no results found"); | |
| testData.iterator().next(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment