kazurayam / ks_comparingElementScreenshots_using_Inspectus

0 stars 0 forks source link

TestObject reated by TestObjectExtension.create(By) works strage #3

Open kazurayam opened 7 months ago

kazurayam commented 7 months ago

Reproducible by https://github.com/kazurayam/ks_comparingElementScreenshots_using_Inspectus/tree/issue3

Run the "Test Cases/MyApple/main", will fail with following messages:

2023-12-05 20:28:53.203 INFO  c.k.k.c.webui.common.WebUiCommonHelper   - Unable to find the element located by 'By.xpath: //*[@cssSelector = 'img#apple']'. Please recheck the objects properties to make sure the desired element is located. 
2023-12-05 20:28:53.354 ERROR c.k.k.core.keyword.internal.KeywordMain  - ❌ com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: 'By.cssSelector: img#apple' located by '//*[@cssSelector = 'img#apple']' not found (Root cause: com.kms.katalon.core.exception.StepFailedException: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: 'By.cssSelector: img#apple' located by '//*[@cssSelector = 'img#apple']' not found
    at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
    at com.kms.katalon.core.webui.keyword.builtin.VerifyElementPresentKeyword$_verifyElementPresent_closure1.doCall(VerifyElementPresentKeyword.groovy:85)
    at com.kms.katalon.core.webui.keyword.builtin.VerifyElementPresentKeyword$_verifyElementPresent_closure1.call(VerifyElementPresentKeyword.groovy)
    at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
    at com.kms.katalon.core.webui.keyword.builtin.VerifyElementPresentKeyword.verifyElementPresent(VerifyElementPresentKeyword.groovy:92)
    at com.kms.katalon.core.webui.keyword.builtin.VerifyElementPresentKeyword.execute(VerifyElementPresentKeyword.groovy:68)
    at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)
    at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.verifyElementPresent(WebUiBuiltInKeywords.groovy:1464)
    at Script1701506093263$_run_closure1.doCall(Script1701506093263.groovy:39)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at processTargetList.run(processTargetList:31)
...
kazurayam commented 7 months ago

The message

WebElementNotFoundException: Web element with id: 'By.cssSelector: img#apple' located by '//[@cssSelector = 'img#apple']' not found (Root cause: com.kms.katalon.core.exception.StepFailedException: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: 'By.cssSelector: img#apple' located by '//[@cssSelector = 'img#apple']' not found

is totally puzzling.

It seems that the TestObject instance created by TestObjectExension.create(By) method is bad.