galenframework / galen

Layout and functional testing framework for websites
http://galenframework.com
1.41k stars 162 forks source link

[pool-1-thread-1] ERROR com.galenframework.api.Galen - Error during setting screenshot. #332

Closed k6Labz closed 9 years ago

k6Labz commented 9 years ago

Hi @ishubin Can you please help me in resolving the this issue:

Galen.test @@ set sauceKey blablanlabnlablablablab................... sauceUser jabbot gridLogin ${sauceUser}:${sauceKey} gridUrl http://${gridLogin}@ondemand.saucelabs.com:80/wd/hub Mobile-Web http://mobile.com

@@ Table devices-for-checkout-page | deviceName | deviceType | gridArgs | | iPhone | mobile-checkout-page | --browser "Android" --dc.platform "Linux" --dc.version "4.4" --dc.device "Samsung Galaxy S4 Emulator" |

@@ Parameterized using devices-for-checkout-page
Checkout page on ${deviceName} selenium grid ${gridUrl} --page ${Mobile-Web} ${gridArgs} run Galen-Homepage-Mobile.js check Galen-Specs.spec --include ${deviceType}

Galen.spec @objects Credit-Card-Mob id ccNum

= Main section = @on mobile-checkout-page
Credit-Card-Mob: width 161px height > 400px

Followings are the complete stack trace:

Test: Checkout page on iPhone

run Galen-Homepage-Mobile.js check Galen.spec --include mobile-checkout-page [pool-1-thread-1] ERROR com.galenframework.api.Galen - Error during setting scre enshot. java.lang.RuntimeException: Error making screenshot at com.galenframework.browser.SeleniumBrowser.createScreenshot(SeleniumB rowser.java:96) at com.galenframework.page.selenium.SeleniumPage.createScreenshot(Seleni umPage.java:171) at com.galenframework.api.Galen.checkLayoutForPage(Galen.java:104) at com.galenframework.api.Galen.checkLayout(Galen.java:90) at com.galenframework.api.Galen.checkLayout(Galen.java:73) at com.galenframework.api.Galen.checkLayout(Galen.java:63) at com.galenframework.suite.actions.GalenPageActionCheck.execute(GalenPa geActionCheck.java:54) at com.galenframework.runner.GalenPageRunner.executeAction(GalenPageRunn er.java:84) at com.galenframework.runner.GalenPageRunner.run(GalenPageRunner.java:76 ) at com.galenframework.runner.GalenBasicTestRunner.runTest(GalenBasicTest Runner.java:76) at com.galenframework.tests.GalenBasicTest.execute(GalenBasicTest.java:5 5) at com.galenframework.TestRunnable.runTest(TestRunnable.java:75) at com.galenframework.TestRunnable.run(TestRunnable.java:101) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: org.openqa.selenium.WebDriverException: Device not accessible via ddm lib. io.selendroid.exceptions.AndroidDeviceException: Device not accessible via ddmli b. at io.selendroid.android.impl.AbstractDevice.takeScreenshot(AbstractDevi ce.java:434) at io.selendroid.server.model.SelendroidStandaloneDriver.takeScreenshot( SelendroidStandaloneDriver.java:550) at io.selendroid.server.handler.CaptureScreenshot.handle(CaptureScreensh ot.java:39) at io.selendroid.server.SelendroidServlet.handleRequest(SelendroidServle t.java:143) at io.selendroid.server.BaseServlet.handleHttpRequest(BaseServlet.java:6 7) at io.selendroid.server.http.ServerHandler.channelRead(ServerHandler.jav a:53) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abst ractChannelHandlerContext.java:333) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(Abstra ctChannelHandlerContext.java:319) at io.netty.handler.traffic.AbstractTrafficShapingHandler.channelRead(Ab stractTrafficShapingHandler.java:223) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abst ractChannelHandlerContext.java:333) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(Abstra ctChannelHandlerContext.java:319) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToM essageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abst ractChannelHandlerContext.java:333) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(Abstra ctChannelHandlerContext.java:319) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessage Decoder.java:163) at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedCha nnelDuplexHandler.java:148) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abst ractChannelHandlerContext.java:333) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(Abstra ctChannelHandlerContext.java:319) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChanne lPipeline.java:787) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(Abstra ctNioByteChannel.java:125) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.jav a:511) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEve ntLoop.java:468) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.ja va:382) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThread EventExecutor.java:116) at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorato r.run(DefaultThreadFactory.java:137) at java.lang.Thread.run(Thread.java:701)

Command duration or timeout: 624 milliseconds Build info: version: 'unknown', revision: 'unknown', time: 'unknown' System info: host: 'SELENIUM', ip: '192.168.1.144', os.name: 'Windows 7', os.a rch: 'amd64', os.version: '6.1', java.version: '1.8.0_60' Driver info: org.openqa.selenium.remote.RemoteWebDriver Capabilities [{emulator=true, aut=android, proxy={proxyAutoconfigUrl=http://127. 0.0.1:19876/pac.js, proxyType=PAC}, webdriver.remote.sessionid=9d0fed1b759e4e389 16700e0f1db022e, platformVersion=19, webdriver.remote.quietExceptions=true, brow serName=android, hasMetadata=true, device=GalaxyS4, platform=ANY}] Session ID: 9d0fed1b759e4e38916700e0f1db022e at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou

rce) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler. java:206) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHa ndler.java:158) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.ja va:595) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.ja va:618) at org.openqa.selenium.remote.RemoteWebDriver.getScreenshotAs(RemoteWebD river.java:320) at com.galenframework.utils.GalenUtils.makeFullScreenshot(GalenUtils.jav a:106) at com.galenframework.browser.SeleniumBrowser.createScreenshot(SeleniumB rowser.java:92) ... 15 more Caused by: org.openqa.selenium.WebDriverException: Device not accessible via ddm lib. io.selendroid.exceptions.AndroidDeviceException: Device not accessible via ddmli b. at io.selendroid.android.impl.AbstractDevice.takeScreenshot(AbstractDevi ce.java:434) at io.selendroid.server.model.SelendroidStandaloneDriver.takeScreenshot( SelendroidStandaloneDriver.java:550) at io.selendroid.server.handler.CaptureScreenshot.handle(CaptureScreensh ot.java:39) at io.selendroid.server.SelendroidServlet.handleRequest(SelendroidServle t.java:143) at io.selendroid.server.BaseServlet.handleHttpRequest(BaseServlet.java:6 7) at io.selendroid.server.http.ServerHandler.channelRead(ServerHandler.jav a:53) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abst ractChannelHandlerContext.java:333) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(Abstra ctChannelHandlerContext.java:319) at io.netty.handler.traffic.AbstractTrafficShapingHandler.channelRead(Ab stractTrafficShapingHandler.java:223) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abst ractChannelHandlerContext.java:333) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(Abstra ctChannelHandlerContext.java:319) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToM essageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abst ractChannelHandlerContext.java:333) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(Abstra ctChannelHandlerContext.java:319) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessage Decoder.java:163) at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedCha nnelDuplexHandler.java:148) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abst ractChannelHandlerContext.java:333) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(Abstra ctChannelHandlerContext.java:319) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChanne lPipeline.java:787) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(Abstra ctNioByteChannel.java:125) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.jav a:511) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEve ntLoop.java:468) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.ja va:382) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThread EventExecutor.java:116) at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorato r.run(DefaultThreadFactory.java:137) at java.lang.Thread.run(Thread.java:701)

Build info: version: 'unknown', revision: 'unknown', time: 'unknown' System info: host: 'SELENIUM', ip: '192.168.1.144', os.name: 'Windows 7', os.a rch: 'amd64', os.version: '6.1', java.version: '1.8.0_60' Driver info: driver.version: unknown = Main section = Credit-Card-Mob: -> width 161px -> : "Credit-Card-Mob" width is 320px instead of 161px -> height > 400px -> : "Credit-Card-Mob" height is 45px but it should be greater than 400px


Failed tests: Checkout page on iPhone

Suite status: FAIL Total tests: 1 Total failed tests: 1 Total failures: 2 There were failures in galen tests

hypery2k commented 9 years ago

you have an error on you appium setup

org.openqa.selenium.WebDriverException: Device not accessible via ddm

Thats no galen error

k6Labz commented 9 years ago

@hypery2k Appreciate your response, is there any work around to fix this Saucelabs side appium issue?

hypery2k commented 9 years ago

not sure what's wrong. Depends on your setup. But you can take a look at my samples: https://github.com/hypery2k/galen_samples/blob/master/javascript/testSuite/bootstrap/runSauceLabs.sh

ishubin commented 9 years ago

This is not a galen related issue

gtpvkr commented 8 years ago

i also facing the same issue could anyone help on it.

[main] ERROR com.galenframework.api.Galen - Error during setting screenshot. java.lang.RuntimeException: Error making screenshot at com.galenframework.browser.SeleniumBrowser.createScreenshot(SeleniumBrowser.java:96) at com.galenframework.page.selenium.SeleniumPage.createScreenshot(SeleniumPage.java:171) at com.galenframework.api.Galen.checkLayoutForPage(Galen.java:104) at com.galenframework.api.Galen.checkLayout(Galen.java:90) at com.galenframework.api.Galen.checkLayout(Galen.java:73) at com.galenframework.api.Galen.checkLayout(Galen.java:63) at com.galenframework.api.Galen.checkLayout(Galen.java:158) at com.galenframework.api.Galen.checkLayout(Galen.java:132) at com.galenframework.java.sample.tests.WelcomePageTest.DriverScript(WelcomePageTest.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80) at org.testng.internal.Invoker.invokeMethod(Invoker.java:715) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:907) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1237) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111) at org.testng.TestRunner.privateRun(TestRunner.java:767) at org.testng.TestRunner.run(TestRunner.java:617) at org.testng.SuiteRunner.runTest(SuiteRunner.java:334) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291) at org.testng.SuiteRunner.run(SuiteRunner.java:240) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:51) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:85) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1197) at org.testng.TestNG.runSuitesLocally(TestNG.java:1122) at org.testng.TestNG.run(TestNG.java:1030) at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:115) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:207) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:178) Caused by: org.openqa.selenium.remote.SessionNotFoundException: no such session (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 4.00 seconds Build info: version: '2.47.1', revision: 'unknown', time: '2015-07-30 11:02:44' System info: host: 'E1422F1L', ip: '10.229.161.185', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_31' Driver info: org.openqa.selenium.remote.RemoteWebDriver Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, chrome={}, takesHeapSnapshot=true, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=33.0.0.0, platform=ANDROID, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}] Session ID: 4eedb113762fa7c0e682e916fd059317 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:164) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:595) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:618) at org.openqa.selenium.remote.RemoteWebDriver.getScreenshotAs(RemoteWebDriver.java:320) at com.galenframework.utils.GalenUtils.takeScreenshot(GalenUtils.java:300) at com.galenframework.browser.SeleniumBrowser.makeSimpleScreenshot(SeleniumBrowser.java:101) at com.galenframework.browser.SeleniumBrowser.createScreenshot(SeleniumBrowser.java:94) ... 32 more

psphanireddy commented 8 years ago

@ishubin, @hypery2k Hi, I am getting an error while running the galen script on emulator device android. I am getting the below error. Currently working on 2.3.0 galen version. Could you please assist on it.

[pool-1-thread-1] ERROR com.galenframework.api.Galen - Error during setting screenshot. java.lang.RuntimeException: Error making screenshot at com.galenframework.page.selenium.SeleniumPage.createNewScreenshot(SeleniumPage.java:177) at com.galenframework.page.selenium.SeleniumPage.getScreenshotFile(SeleniumPage.java:164) at com.galenframework.api.Galen.checkLayoutForPage(Galen.java:100) at com.galenframework.api.Galen.checkLayout(Galen.java:86) at com.galenframework.api.Galen.checkLayout(Galen.java:69) at com.galenframework.api.Galen.checkLayout(Galen.java:59) at com.galenframework.suite.actions.GalenPageActionCheck.execute(GalenPageActionCheck.java:53) at com.galenframework.runner.GalenPageRunner.executeAction(GalenPageRunner.java:84) at com.galenframework.runner.GalenPageRunner.run(GalenPageRunner.java:76) at com.galenframework.runner.GalenBasicTestRunner.runTest(GalenBasicTestRunner.java:76) at com.galenframework.tests.GalenBasicTest.execute(GalenBasicTest.java:55) at com.galenframework.TestRunnable.runTest(TestRunnable.java:75) at com.galenframework.TestRunnable.run(TestRunnable.java:101) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

gtpvkr commented 8 years ago

Hey guys it's not working on emulators, but it's working fine with real devices, basically webdriver or any other driver could not able to take screenshot on emulators.

ishubin commented 8 years ago

There are issues with screenshots on specific mobile devices and emulators. Unfortunately there is nothing we can do about that in Galen

t2hv33 commented 6 years ago

In Real device (Android), update lastest Chrome Driver & Appium com.galenframework.api.Galen - Error during setting screenshot. this error is fixed. Not test on iOS yet.