vmi / selenese-runner-java

Selenium IDE native format (selenese and side) interpreter.
Other
140 stars 83 forks source link

waitFor* commands should result in an error, not a warning #330

Closed blutorange closed 2 years ago

blutorange commented 3 years ago

WaitFor* command currently only result in a warning (https://github.com/vmi/selenese-runner-java/blob/master/src/main/java/jp/vmi/selenium/selenese/command/Assertion.java#L145). With Selenium IDE, they result in an error:

image

When these commands fail, they usually represent a test failure (element not present that was expected etc.). I'm using the this library programatically to integrate side tests in JUnit. When these commands only result in a warning, the test does not fail as it should. As a workaround, I'm now checking whether the result message contains the text "Assertion failed".

Can this be changed to an error?

shenlian8 commented 3 years ago

It is right to return warning.

If you need you can use assert... commands.

You can also conbine them.

Wait... and then Assert...

This give you more possibilities.

Andre Wachsmuth @.***> 于 2021年9月7日周二 17:40写道:

WaitFor* command currently only result in a warning ( https://github.com/vmi/selenese-runner-java/blob/master/src/main/java/jp/vmi/selenium/selenese/command/Assertion.java#L145). With Selenium IDE, they result in an error:

[image: image] https://user-images.githubusercontent.com/2456413/132372335-c3dded16-fa77-442f-844d-0d107140dfe8.png

When these commands fail, they usually represent a test failure (element not present that was expected etc.). I'm using the this library programatically to integrate side tests in JUnit. When these commands only result in a warning, the test does not fail as it should. As a workaround, I'm now checking whether the result message contains the text "Assertion failed".

Can this be changed to an error? Alternatively, it would help if the jp.vmi.selenium.selenese.result.Result contained more info on the command that failed, then we could check whether it is an assertion command and fail if so.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vmi/selenese-runner-java/issues/330, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACJFNH3IR4KFUMFJBIF353TUAYXALANCNFSM5DSVNH7A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

blutorange commented 3 years ago

Well, the problem is there's no Assert element not visible command, only a Wait for element not visible command in Selenium IDE. I'm not sure about the precise goals of this project, should it mimic the behavior of Selenium IDE?

shenlian8 commented 3 years ago

Just some expierence.

Not visible is always not save.

Andre Wachsmuth @.***> 于 2021年9月7日周二 18:37写道:

Well, the problem is there's not "Assert element not visible" command, only a "Wait for element not visible command" in Selenium IDE.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/vmi/selenese-runner-java/issues/330#issuecomment-914457481, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACJFNH4U4PB25A73GFYUUBLUAY5VJANCNFSM5DSVNH7A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

vmi commented 3 years ago

I'm sorry for the delay.

I will fix it, so please wait for a while.

I'm not sure about the precise goals of this project, should it mimic the behavior of Selenium IDE?

The goal of this project is to mimic Selenium IDE as accurately as possible. (this is limited to what can be implemented with the functions provided by WebDriver)

Note that the current behavior is due to the fact that I am following the legacy Selenium IDE.

blutorange commented 3 years ago

@vmi No problem, take your time, it's not urgent. For the time being I'm using using my own runner implementation so I can check which command failed and act accordingly.

As far as I know over at Selenium IDE they started rewriting it as an electron app with native WebDriver support to overcome some of the issues with it being a browser plugin, but it seems that project has a long way to go. Though that would probably be easier to mimic.

vmi commented 2 years ago

Thank you very much for your patience. I have released version 4.0.0 that fixes this problem. Please check it out.

blutorange commented 2 years ago

No problem, thanks for the fix and the release. I checked it out, works as I would have expected it : )