galasa-dev / projectmanagement

Project Management repo for Issues and ZenHub
7 stars 4 forks source link

FileNotFoundException during takeScreenshot() with selenium grid on ecosystem #1913

Open haripra86 opened 3 months ago

haripra86 commented 3 months ago

Steps to reproduce :

1 > Create a test which calls page.takeScreenShot(); 2 > Select selenium grid or remote webdriver.

selenium.default.driver=CHROME selenium.driver.type=grid selenium.grid.endpoint=http://selenium-service:4444 selenium.driver.max.slots=2

3 > Submit test to galasa ecosystem

Expected : Test should pass with screeshot embeded to test artifacts.

Actual :

Exception thrown as below :

01/07/2024 08:57:12.422 INFO  i.z.z.t.a.t.BV_Tests - page title : AppDynamics
01/07/2024 08:57:12.863 INFO  d.g.r.c.i.CouchdbRasWriteByteChannel - Stored artifact /selenium/screenshots/test_selenium_demo/screenshot_1719824232822.png length=0 contentType=plain/text
01/07/2024 08:57:12.892 INFO  d.g.r.c.i.CouchdbRasWriteByteChannel - Stored artifact /selenium/screenshots/test_selenium_demo/screenshot_1719824232822.png length=35962 contentType=image/png
01/07/2024 08:57:12.894 INFO  o.a.h.i.e.RetryExec - I/O exception (java.io.FileNotFoundException) caught when processing request to {}->http://galasa-ecosystem-couchdb:5984: /tmp/galasa_couchdb6357116004075991331temp (No such file or directory)
01/07/2024 08:57:12.894 INFO  o.a.h.i.e.RetryExec - Retrying request to {}->http://galasa-ecosystem-couchdb:5984
01/07/2024 08:57:12.895 INFO  o.a.h.i.e.RetryExec - I/O exception (java.io.FileNotFoundException) caught when processing request to {}->http://galasa-ecosystem-couchdb:5984: /tmp/galasa_couchdb6357116004075991331temp (No such file or directory)
01/07/2024 08:57:12.895 INFO  o.a.h.i.e.RetryExec - Retrying request to {}->http://galasa-ecosystem-couchdb:5984
01/07/2024 08:57:12.896 INFO  o.a.h.i.e.RetryExec - I/O exception (java.io.FileNotFoundException) caught when processing request to {}->http://galasa-ecosystem-couchdb:5984: /tmp/galasa_couchdb6357116004075991331temp (No such file or directory)
01/07/2024 08:57:12.896 INFO  o.a.h.i.e.RetryExec - Retrying request to {}->http://galasa-ecosystem-couchdb:5984
01/07/2024 08:57:12.907 INFO  d.g.f.GenericMethodWrapper - Ending
----------------------- ****************************************************************************************************
----------------------- *** Failed - Test method ibm.zaiops.zapm.tests.appdynamics.tests.BV_Tests#test_selenium_demo,type=Test
----------------------- ****************************************************************************************************
dev.galasa.selenium.SeleniumManagerException: Unable to take screenshot
    at dev.galasa.selenium.internal.WebPageImpl.takeScreenShot(WebPageImpl.java:667)
    at ibm.zaiops.zapm.tests.appdynamics.selenium.stepdefn.AppDynamics.openBrowserAndLogin(AppDynamics.java:30)
    at ibm.zaiops.zapm.tests.appdynamics.stepdefn.TestSetpDefns.open_Selenium_Browser_and_login_to_AppDynamicsUI(TestSetpDefns.java:266)
    at ibm.zaiops.zapm.tests.appdynamics.tests.BV_Tests.test_selenium_demo(BV_Tests.java:77)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at dev.galasa.framework.GenericMethodWrapper.invoke(GenericMethodWrapper.java:88)
    at dev.galasa.framework.TestMethodWrapper.invoke(TestMethodWrapper.java:61)
    at dev.galasa.framework.TestClassWrapper.runTestMethods(TestClassWrapper.java:216)
    at dev.galasa.framework.TestRunner.runTestClassWrapper(TestRunner.java:607)
    at dev.galasa.framework.TestRunner.runEnvironment(TestRunner.java:581)
    at dev.galasa.framework.TestRunner.createEnvironment(TestRunner.java:546)
    at dev.galasa.framework.TestRunner.generateEnvironment(TestRunner.java:503)
    at dev.galasa.framework.TestRunner.runTest(TestRunner.java:424)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at dev.galasa.boot.felix.FelixFramework.runTest(FelixFramework.java:248)
    at dev.galasa.boot.Launcher.launch(Launcher.java:172)
    at dev.galasa.boot.Launcher.main(Launcher.java:122)
Caused by: java.io.IOException: Unable to store artifact attachment
    at dev.galasa.ras.couchdb.internal.CouchdbRasWriteByteChannel.close(CouchdbRasWriteByteChannel.java:132)
    at java.base/java.nio.channels.Channels$1.close(Channels.java:177)
    at dev.galasa.selenium.internal.WebPageImpl.takeScreenShot(WebPageImpl.java:665)
    ... 22 more
Caused by: java.io.FileNotFoundException: /tmp/galasa_couchdb6357116004075991331temp (No such file or directory)
    at java.base/java.io.FileInputStream.open0(Native Method)
    at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
    at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
    at org.apache.http.entity.FileEntity.writeTo(FileEntity.java:108)
    at org.apache.http.impl.DefaultBHttpClientConnection.sendRequestEntity(DefaultBHttpClientConnection.java:156)
    at org.apache.http.impl.conn.CPoolProxy.sendRequestEntity(CPoolProxy.java:152)
    at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:238)
    at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123)
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:272)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
    at dev.galasa.ras.couchdb.internal.CouchdbRasWriteByteChannel.close(CouchdbRasWriteByteChannel.java:109)
    ... 24 more

01/07/2024 08:57:12.908 WARN  d.g.f.TestMethodWrapper - Test method failed, however, continue on test failure was requested, so carrying on
01/07/2024 08:57:12.932 INFO  d.g.f.TestClassWrapper - Ending`
techcobweb commented 3 months ago

Thanks for the issue. We currently don't have a selenium grid set up, and are pretty busy on other things right now so this one may take some time to get to. Sorry.