Hallo,
I want to test a Timeline in selenium tests. I get an exception, when I try to select an event by waitForElementClickable:
I think, the problem is in this code:
this.mainView is a TimelineView and there exist no function getSelectedTab() for a CalendarView.
Peter
I want to test a Timeline in selenium tests. I get an exception, when I try to select an event by waitForElementClickable:
Code:
org.openqa.selenium.WebDriverException: unknown error: this.mainView.getSelectedTab is not a function (Session info: chrome=52.0.2743.116) (Driver info: chromedriver=2.23.409699 (49b0fa931cda1caad0ae15b7d1b68004acd05129),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 15 milliseconds Build info: version: '2.53.1', revision: 'a36b8b1cd5757287168e54b817830adce9b0158d', time: '2016-06-30 19:26:09' System info: host: 'leine', ip: '172.25.8.158', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_51' Session ID: 891d8d194ac8bd8b08fb67332eceb1f7 Driver info: org.openqa.selenium.chrome.ChromeDriver Capabilities [{platform=XP, acceptSslCerts=true, javascriptEnabled=true, browserName=chrome, chrome={userDataDir=C:\Users\pepe\AppData\Local\Temp\scoped_dir5376_1211, chromedriverVersion=2.23.409699 (49b0fa931cda1caad0ae15b7d1b68004acd05129)}, networkConnectionEnabled=false, rotatable=false, locationContextEnabled=true, mobileEmulationEnabled=false, version=52.0.2743.116, takesHeapSnapshot=true, databaseEnabled=false, cssSelectorsEnabled=true, handlesAlerts=true, browserConnectionEnabled=false, webStorageEnabled=true, nativeEvents=true, hasTouchScreen=false, applicationCacheEnabled=false, takesScreenshot=true}] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678) at org.openqa.selenium.remote.RemoteWebDriver.executeScript(RemoteWebDriver.java:577) at com.isomorphic.webdriver.ByScLocator.findElements(ByScLocator.java:72) at org.openqa.selenium.remote.RemoteWebDriver.findElements(RemoteWebDriver.java:351) at com.isomorphic.webdriver.SmartClientWebDriver.findElements(SmartClientWebDriver.java:1251) at com.isomorphic.webdriver.SmartClientWebDriver$Waiter.operation(SmartClientWebDriver.java:351) at com.isomorphic.webdriver.SmartClientWebDriver$Waiter.waitFor(SmartClientWebDriver.java:368) at com.isomorphic.webdriver.SmartClientWebDriver.waitForJavascriptFunction(SmartClientWebDriver.java:333) at com.isomorphic.webdriver.SmartClientWebDriver.waitForElementClickable(SmartClientWebDriver.java:131) at com.isomorphic.webdriver.SmartClientWebDriver.waitForElementClickable(SmartClientWebDriver.java:120) at de.alfamedia.agendatest.client.pages.RosterPage.doubleClickEvent(RosterPage.java:144) at de.alfamedia.agendatest.client.pages.RosterPage.doubleClickServiceTimelineEvent(RosterPage.java:62) at de.alfamedia.agendatest.client.roster.RosterEditTests.editServiceTimelineRoster(RosterEditTests.java:93) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86) at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Code:
// substring param really just used for logging getChildFromFallbackLocator : function calendar_getChildFromFallbackLocator (substring, fallbackLocatorConfig) { var type = fallbackLocatorConfig.name, config = fallbackLocatorConfig.config; if (type == "eventWindow" || type == "eventCanvas") { var viewName = this.mainView.getSelectedTab().viewName; <================= Here if (viewName == "day") { var children = this.dayView.body.children; } else if (viewName == "week") { var children = this.weekView.body.children; }
Peter
Comment