kazurayam / VisualInspectionInKatalonStudio_Reborn

A Katalon Studio project. This project performs automated Web UI testing with screenshot comparison and HTML source comparison.
1 stars 0 forks source link

MaterialstoreException: the left material is not an image ... #25

Open kazurayam opened 1 year ago

kazurayam commented 1 year ago

I had Include/data/MyAdmin/targetList.Prod.csv:

http://myadmin.kazurayam.com/index.html,//img[@alt='umineko']

and Include/data/MyAdmin/targetList.Dev.csv:

http://devadmin.kazurayam.com/,//img[@alt='umineko']

Please note the "path" part of URL is different, one has a path of "/", another has a path of "/index.html".

When I executed the "Test Cases/main/MyAdmin/0_Main_Twins", I got the following Error:

2022-11-17 23:11:50.284 INFO  c.k.katalon.core.main.TestCaseExecutor   - CALL Test Cases/main/MyAdmin/3_reduceTwins
2022-11-17 23:11:50.482 INFO  c.k.k.c.keyword.builtin.CommentKeyword   - reduce started; store=/Users/kazuakiurayama/katalon-workspace/VisualInspectionInKatalonStudio_Reborn/store
2022-11-17 23:11:50.489 INFO  c.k.k.c.keyword.builtin.CommentKeyword   - reduce started; leftMaterialList={"jobName":"MyAdmin","jobTimestamp":"20221117_231128","queryOnMetadata":{"profile":"MyAdmin_ProductionEnv"},"materialList":[{"jobName":"MyAdmin","jobTimestamp":"20221117_231128","id":"93f19f62774550aade8ceb9657405c2624c720a0","fileType":"png","metadata":{"profile":{"key":"profile","value":"MyAdmin_ProductionEnv","matchedIndividually":true}, "URL.host":{"key":"URL.host","value":"myadmin.kazurayam.com"}, "URL.path":{"key":"URL.path","value":"/index.html"}, "URL.port":{"key":"URL.port","value":"80"}, "URL.protocol":{"key":"URL.protocol","value":"http"}},"identification":"{\"profile\":\"MyAdmin_ProductionEnv\", \"URL.host\":\"myadmin.kazurayam.com\", \"URL.path\":\"/index.html\", \"URL.port\":\"80\", \"URL.protocol\":\"http\"}","metadataURL":"http://myadmin.kazurayam.com/index.html","relativeUrl":"MyAdmin/20221117_231128/objects/93f19f62774550aade8ceb9657405c2624c720a0.png","diffability":"AS_IMAGE"},{"jobName":"MyAdmin","jobTimestamp":"20221117_231128","id":"0db0532c9deb5c67f165e1ad867f96048f4ab017","fileType":"html","metadata":{"profile":{"key":"profile","value":"MyAdmin_ProductionEnv","matchedIndividually":true}, "URL.host":{"key":"URL.host","value":"myadmin.kazurayam.com"}, "URL.path":{"key":"URL.path","value":"/index.html"}, "URL.port":{"key":"URL.port","value":"80"}, "URL.protocol":{"key":"URL.protocol","value":"http"}},"identification":"{\"profile\":\"MyAdmin_ProductionEnv\", \"URL.host\":\"myadmin.kazurayam.com\", \"URL.path\":\"/index.html\", \"URL.port\":\"80\", \"URL.protocol\":\"http\"}","metadataURL":"http://myadmin.kazurayam.com/index.html","relativeUrl":"MyAdmin/20221117_231128/objects/0db0532c9deb5c67f165e1ad867f96048f4ab017.html","diffability":"AS_TEXT"},{"jobName":"MyAdmin","jobTimestamp":"20221117_231128","id":"26559bf754cfc8a7269ac4d7f88ed552b68624ab","fileType":"png","metadata":{"profile":{"key":"profile","value":"MyAdmin_ProductionEnv","matchedIndividually":true}, "URL.host":{"key":"URL.host","value":"myadmin.kazurayam.com"}, "URL.path":{"key":"URL.path","value":"/repositories.html"}, "URL.port":{"key":"URL.port","value":"80"}, "URL.protocol":{"key":"URL.protocol","value":"http"}},"identification":"{\"profile\":\"MyAdmin_ProductionEnv\", \"URL.host\":\"myadmin.kazurayam.com\", \"URL.path\":\"/repositories.html\", \"URL.port\":\"80\", \"URL.protocol\":\"http\"}","metadataURL":"http://myadmin.kazurayam.com/repositories.html","relativeUrl":"MyAdmin/20221117_231128/objects/26559bf754cfc8a7269ac4d7f88ed552b68624ab.png","diffability":"AS_IMAGE"},{"jobName":"MyAdmin","jobTimestamp":"20221117_231128","id":"03a4cd8c6ad2f6282080b44622628cdbfb84fbb1","fileType":"html","metadata":{"profile":{"key":"profile","value":"MyAdmin_ProductionEnv","matchedIndividually":true}, "URL.host":{"key":"URL.host","value":"myadmin.kazurayam.com"}, "URL.path":{"key":"URL.path","value":"/repositories.html"}, "URL.port":{"key":"URL.port","value":"80"}, "URL.protocol":{"key":"URL.protocol","value":"http"}},"identification":"{\"profile\":\"MyAdmin_ProductionEnv\", \"URL.host\":\"myadmin.kazurayam.com\", \"URL.path\":\"/repositories.html\", \"URL.port\":\"80\", \"URL.protocol\":\"http\"}","metadataURL":"http://myadmin.kazurayam.com/repositories.html","relativeUrl":"MyAdmin/20221117_231128/objects/03a4cd8c6ad2f6282080b44622628cdbfb84fbb1.html","diffability":"AS_TEXT"},{"jobName":"MyAdmin","jobTimestamp":"20221117_231128","id":"b2250fcb54639acf521223ae408fff1da0343126","fileType":"png","metadata":{"profile":{"key":"profile","value":"MyAdmin_ProductionEnv","matchedIndividually":true}, "URL.host":{"key":"URL.host","value":"myadmin.kazurayam.com"}, "URL.path":{"key":"URL.path","value":"/proverbs.html"}, "URL.port":{"key":"URL.port","value":"80"}, "URL.protocol":{"key":"URL.protocol","value":"http"}},"identification":"{\"profile\":\"MyAdmin_ProductionEnv\", \"URL.host\":\"myadmin.kazurayam.com\", \"URL.path\":\"/proverbs.html\", \"URL.port\":\"80\", \"URL.protocol\":\"http\"}","metadataURL":"http://myadmin.kazurayam.com/proverbs.html","relativeUrl":"MyAdmin/20221117_231128/objects/b2250fcb54639acf521223ae408fff1da0343126.png","diffability":"AS_IMAGE"},{"jobName":"MyAdmin","jobTimestamp":"20221117_231128","id":"6bfd6eaa0df57f1c2d349c10f4fa11a475f978b7","fileType":"html","metadata":{"profile":{"key":"profile","value":"MyAdmin_ProductionEnv","matchedIndividually":true}, "URL.host":{"key":"URL.host","value":"myadmin.kazurayam.com"}, "URL.path":{"key":"URL.path","value":"/proverbs.html"}, "URL.port":{"key":"URL.port","value":"80"}, "URL.protocol":{"key":"URL.protocol","value":"http"}},"identification":"{\"profile\":\"MyAdmin_ProductionEnv\", \"URL.host\":\"myadmin.kazurayam.com\", \"URL.path\":\"/proverbs.html\", \"URL.port\":\"80\", \"URL.protocol\":\"http\"}","metadataURL":"http://myadmin.kazurayam.com/proverbs.html","relativeUrl":"MyAdmin/20221117_231128/objects/6bfd6eaa0df57f1c2d349c10f4fa11a475f978b7.html","diffability":"AS_TEXT"}]}
2022-11-17 23:11:50.497 INFO  c.k.k.c.keyword.builtin.CommentKeyword   - reduce started; rightMaterialList={"jobName":"MyAdmin","jobTimestamp":"20221117_231141","queryOnMetadata":{"profile":"MyAdmin_DevelopmentEnv"},"materialList":[{"jobName":"MyAdmin","jobTimestamp":"20221117_231141","id":"35f7e45cc8d2b1b56c724902b1b9b6a2f853ab4b","fileType":"png","metadata":{"profile":{"key":"profile","value":"MyAdmin_DevelopmentEnv","matchedIndividually":true}, "URL.host":{"key":"URL.host","value":"devadmin.kazurayam.com"}, "URL.path":{"key":"URL.path","value":"/"}, "URL.port":{"key":"URL.port","value":"80"}, "URL.protocol":{"key":"URL.protocol","value":"http"}},"identification":"{\"profile\":\"MyAdmin_DevelopmentEnv\", \"URL.host\":\"devadmin.kazurayam.com\", \"URL.path\":\"/\", \"URL.port\":\"80\", \"URL.protocol\":\"http\"}","metadataURL":"http://devadmin.kazurayam.com/","relativeUrl":"MyAdmin/20221117_231141/objects/35f7e45cc8d2b1b56c724902b1b9b6a2f853ab4b.png","diffability":"AS_IMAGE"},{"jobName":"MyAdmin","jobTimestamp":"20221117_231141","id":"5f902eea7e520cc04a1e65ff61d3cd428ee9c90a","fileType":"html","metadata":{"profile":{"key":"profile","value":"MyAdmin_DevelopmentEnv","matchedIndividually":true}, "URL.host":{"key":"URL.host","value":"devadmin.kazurayam.com"}, "URL.path":{"key":"URL.path","value":"/"}, "URL.port":{"key":"URL.port","value":"80"}, "URL.protocol":{"key":"URL.protocol","value":"http"}},"identification":"{\"profile\":\"MyAdmin_DevelopmentEnv\", \"URL.host\":\"devadmin.kazurayam.com\", \"URL.path\":\"/\", \"URL.port\":\"80\", \"URL.protocol\":\"http\"}","metadataURL":"http://devadmin.kazurayam.com/","relativeUrl":"MyAdmin/20221117_231141/objects/5f902eea7e520cc04a1e65ff61d3cd428ee9c90a.html","diffability":"AS_TEXT"},{"jobName":"MyAdmin","jobTimestamp":"20221117_231141","id":"33c8dcc0004dd5d49db58d81eb56997aec00a119","fileType":"png","metadata":{"profile":{"key":"profile","value":"MyAdmin_DevelopmentEnv","matchedIndividually":true}, "URL.host":{"key":"URL.host","value":"devadmin.kazurayam.com"}, "URL.path":{"key":"URL.path","value":"/repositories.html"}, "URL.port":{"key":"URL.port","value":"80"}, "URL.protocol":{"key":"URL.protocol","value":"http"}},"identification":"{\"profile\":\"MyAdmin_DevelopmentEnv\", \"URL.host\":\"devadmin.kazurayam.com\", \"URL.path\":\"/repositories.html\", \"URL.port\":\"80\", \"URL.protocol\":\"http\"}","metadataURL":"http://devadmin.kazurayam.com/repositories.html","relativeUrl":"MyAdmin/20221117_231141/objects/33c8dcc0004dd5d49db58d81eb56997aec00a119.png","diffability":"AS_IMAGE"},{"jobName":"MyAdmin","jobTimestamp":"20221117_231141","id":"161599eb7e32dc884767da83734006c883dc1a56","fileType":"html","metadata":{"profile":{"key":"profile","value":"MyAdmin_DevelopmentEnv","matchedIndividually":true}, "URL.host":{"key":"URL.host","value":"devadmin.kazurayam.com"}, "URL.path":{"key":"URL.path","value":"/repositories.html"}, "URL.port":{"key":"URL.port","value":"80"}, "URL.protocol":{"key":"URL.protocol","value":"http"}},"identification":"{\"profile\":\"MyAdmin_DevelopmentEnv\", \"URL.host\":\"devadmin.kazurayam.com\", \"URL.path\":\"/repositories.html\", \"URL.port\":\"80\", \"URL.protocol\":\"http\"}","metadataURL":"http://devadmin.kazurayam.com/repositories.html","relativeUrl":"MyAdmin/20221117_231141/objects/161599eb7e32dc884767da83734006c883dc1a56.html","diffability":"AS_TEXT"},{"jobName":"MyAdmin","jobTimestamp":"20221117_231141","id":"83fc345304d0254e1d799176b43f478faab0005b","fileType":"png","metadata":{"profile":{"key":"profile","value":"MyAdmin_DevelopmentEnv","matchedIndividually":true}, "URL.host":{"key":"URL.host","value":"devadmin.kazurayam.com"}, "URL.path":{"key":"URL.path","value":"/proverbs.html"}, "URL.port":{"key":"URL.port","value":"80"}, "URL.protocol":{"key":"URL.protocol","value":"http"}},"identification":"{\"profile\":\"MyAdmin_DevelopmentEnv\", \"URL.host\":\"devadmin.kazurayam.com\", \"URL.path\":\"/proverbs.html\", \"URL.port\":\"80\", \"URL.protocol\":\"http\"}","metadataURL":"http://devadmin.kazurayam.com/proverbs.html","relativeUrl":"MyAdmin/20221117_231141/objects/83fc345304d0254e1d799176b43f478faab0005b.png","diffability":"AS_IMAGE"},{"jobName":"MyAdmin","jobTimestamp":"20221117_231141","id":"74e4a1c3b26c112495f8013c9cbf370f8078111e","fileType":"html","metadata":{"profile":{"key":"profile","value":"MyAdmin_DevelopmentEnv","matchedIndividually":true}, "URL.host":{"key":"URL.host","value":"devadmin.kazurayam.com"}, "URL.path":{"key":"URL.path","value":"/proverbs.html"}, "URL.port":{"key":"URL.port","value":"80"}, "URL.protocol":{"key":"URL.protocol","value":"http"}},"identification":"{\"profile\":\"MyAdmin_DevelopmentEnv\", \"URL.host\":\"devadmin.kazurayam.com\", \"URL.path\":\"/proverbs.html\", \"URL.port\":\"80\", \"URL.protocol\":\"http\"}","metadataURL":"http://devadmin.kazurayam.com/proverbs.html","relativeUrl":"MyAdmin/20221117_231141/objects/74e4a1c3b26c112495f8013c9cbf370f8078111e.html","diffability":"AS_TEXT"}]}
2022-11-17 23:11:51.185 ERROR c.k.katalon.core.main.TestCaseExecutor   - ❌ Test Cases/main/MyAdmin/3_reduceTwins FAILED.
Reason:
com.kazurayam.materialstore.core.filesystem.MaterialstoreException: the left material is not an image: {"jobName":"_","jobTimestamp":"_","id":"0000000000000000000000000000000000000000","fileType":"","metadata":{},"identification":"{}","relativeUrl":"_/_/objects/0000000000000000000000000000000000000000.","diffability":"UNABLE"}
    at com.kazurayam.materialstore.base.reduce.differ.ImageDifferToPNG.stuffDiff(ImageDifferToPNG.java:40)
    at com.kazurayam.materialstore.base.reduce.DiffingMPGProcessor.stuffDiffByDiffer(DiffingMPGProcessor.java:68)
    at com.kazurayam.materialstore.base.reduce.DiffingMPGProcessor.process(DiffingMPGProcessor.java:41)
    at com.kazurayam.materialstore.base.inspector.InspectorImpl.reduceAndSort(InspectorImpl.java:45)
    at com.kazurayam.materialstore.base.inspector.InspectorImpl$reduceAndSort$0.call(Unknown Source)
    at 3_reduceTwins.run(3_reduceTwins:32)
    at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
    at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
    at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:445)
    at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:436)
    at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:415)
    at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:407)
    at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:284)
    at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:142)
    at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.doCall(CallTestCaseKeyword.groovy:59)
    at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.call(CallTestCaseKeyword.groovy)
    at com.kms.katalon.core.keyword.internal.KeywordMain.runKeyword(KeywordMain.groovy:74)
    at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.callTestCase(CallTestCaseKeyword.groovy:81)
    at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.execute(CallTestCaseKeyword.groovy:44)
    at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)
    at com.kms.katalon.core.keyword.BuiltinKeywords.callTestCase(BuiltinKeywords.groovy:350)
    at 0_Main_Twins.run(0_Main_Twins:93)
    at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
    at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
    at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:445)
    at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:436)
    at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:415)
    at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:407)
    at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:284)
    at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:142)
    at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:133)
    at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
    at TempTestCase1668694282042.run(TempTestCase1668694282042.groovy:25)

2022-11-17 23:11:51.196 ERROR c.k.katalon.core.main.TestCaseExecutor   - ❌ Test Cases/main/MyAdmin/3_reduceTwins FAILED.
Reason:
com.kazurayam.materialstore.core.filesystem.MaterialstoreException: the left material is not an image: {"jobName":"_","jobTimestamp":"_","id":"0000000000000000000000000000000000000000","fileType":"","metadata":{},"identification":"{}","relativeUrl":"_/_/objects/0000000000000000000000000000000000000000.","diffability":"UNABLE"}
    at com.kazurayam.materialstore.base.reduce.differ.ImageDifferToPNG.stuffDiff(ImageDifferToPNG.java:40)
    at com.kazurayam.materialstore.base.reduce.DiffingMPGProcessor.stuffDiffByDiffer(DiffingMPGProcessor.java:68)
    at com.kazurayam.materialstore.base.reduce.DiffingMPGProcessor.process(DiffingMPGProcessor.java:41)
    at com.kazurayam.materialstore.base.inspector.InspectorImpl.reduceAndSort(InspectorImpl.java:45)
    at com.kazurayam.materialstore.base.inspector.InspectorImpl$reduceAndSort$0.call(Unknown Source)
    at 3_reduceTwins.run(3_reduceTwins:32)
    at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
    at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
    at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:445)
    at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:436)
    at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:415)
    at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:407)
    at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:284)
    at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:142)
    at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.doCall(CallTestCaseKeyword.groovy:59)
    at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.call(CallTestCaseKeyword.groovy)
    at com.kms.katalon.core.keyword.internal.KeywordMain.runKeyword(KeywordMain.groovy:74)
    at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.callTestCase(CallTestCaseKeyword.groovy:81)
    at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.execute(CallTestCaseKeyword.groovy:44)
    at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)
    at com.kms.katalon.core.keyword.BuiltinKeywords.callTestCase(BuiltinKeywords.groovy:350)
    at 0_Main_Twins.run(0_Main_Twins:93)
    at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
    at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
    at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:445)
    at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:436)
    at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:415)
    at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:407)
    at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:284)
    at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:142)
    at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:133)
    at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
    at TempTestCase1668694282042.run(TempTestCase1668694282042.groovy:25)

2022-11-17 23:11:51.199 INFO  c.k.katalon.core.main.TestCaseExecutor   - END CALL Test Cases/main/MyAdmin/3_reduceTwins

The processing stopped due to the Exception.


If the given pair of URL is inconsitent, the reduce process will ditect the inconsistency. It tried to create a MaterialProduct object with both of the Left and the Right fullfilled, but failed to find it.

Then a question is, how the reduce process should behave after the detection. Should it stop everything? or continue?

Now, it stops everything; this is bad.

It should continue and report as much information in the format of HTML report.

kazurayam commented 1 year ago

Not only ImageDiffer, but also TextDiffer must be fixed