MarketSquare / robotframework-seleniumlibrary-java

Java port of the Python based SeleniumLibrary for Robot Framework
Apache License 2.0
23 stars 16 forks source link

Are there any plans to update javalib-core dependency to newer version? #111

Closed boog1ebug closed 2 years ago

boog1ebug commented 3 years ago

Hi,

Currently other RF java libraries (like swinglibrary) have moved to

org.robotframework javalib-core 2.0.3

I see that robotframework-seleniumlibrary still uses:

org.robotframework javalib-core 1.2.1

Currently this causes dependecy conflicts in maven projects that needs to use (for example) both libraries mentioned above. It seems version 2.0.3 of javalib-core is not backwards compatible. Keywords executed from Robot Framework layer will always fail with java.lang.IllegalArgumentException: argument type mismatch

KEYWORD weblibrary . Capture Page Screenshot Documentation:

Take a screenshot of the current page and embed it into the log. Start / End / Elapsed: 20210210 15:22:55.449 / 20210210 15:22:55.479 / 00:00:00.030 15:22:55.452 TRACE Arguments: [ ]
15:22:55.477 FAIL java.lang.IllegalArgumentException: argument type mismatch
15:22:55.478 DEBUG java.lang.RuntimeException: at org.robotframework.javalib.reflection.KeywordInvoker.invoke(KeywordInvoker.java:65) at org.robotframework.javalib.beans.annotation.AnnotationKeywordExtractor$1.execute(AnnotationKeywordExtractor.java:66) at org.robotframework.javalib.library.KeywordFactoryBasedLibrary.runKeyword(KeywordFactoryBasedLibrary.java:40) at org.robotframework.javalib.library.AnnotationLibrary.runKeyword(AnnotationLibrary.java:129) at robot.libraries.BuiltIn$py.run_keyword$106(C:/Users/hifi/git/robotframework/build/Lib/robot/libraries/BuiltIn.py:1651) at robot.libraries.BuiltIn$py.call_function(C:/Users/hifi/git/robotframework/build/Lib/robot/libraries/BuiltIn.py) at com.github.markusbernhardt.seleniumlibrary.keywords.RunOnFailure.runOnFailure(RunOnFailure.java:83) at com.github.markusbernhardt.seleniumlibrary.RunOnFailureKeywordsAdapter.runOnFailureByAspectJ(RunOnFailureKeywordsAdapter.java:20) at com.github.markusbernhardt.seleniumlibrary.aspects.RunOnFailureAspect.ajc$afterThrowing$com_github_markusbernhardt_seleniumlibrary_aspects_RunOnFailureAspect$1$28ae5ef9(RunOnFailureAspect.aj:21) at com.github.markusbernhardt.seleniumlibrary.keywords.Element.clickElement(Element.java:575) at libraries.weblibrary.keywords.Login.search(Login.java:45) at org.robotframework.javalib.reflection.KeywordInvoker.invoke(KeywordInvoker.java:63) at org.robotframework.javalib.beans.annotation.AnnotationKeywordExtractor$1.execute(AnnotationKeywordExtractor.java:66) at org.robotframework.javalib.library.KeywordFactoryBasedLibrary.runKeyword(KeywordFactoryBasedLibrary.java:40) at org.robotframework.javalib.library.AnnotationLibrary.runKeyword(AnnotationLibrary.java:129) at robot.model.testcase$py.visit$8(C:/Users/hifi/git/robotframework/build/Lib/robot/model/testcase.py:78) at robot.model.testcase$py.call_function(C:/Users/hifi/git/robotframework/build/Lib/robot/model/testcase.py) at robot.model.itemlist$py.visit$12(C:/Users/hifi/git/robotframework/build/Lib/robot/model/itemlist.py:76) at robot.model.itemlist$py.call_function(C:/Users/hifi/git/robotframework/build/Lib/robot/model/itemlist.py) at robot.model.visitor$py.visit_suite$2(C:/Users/hifi/git/robotframework/build/Lib/robot/model/visitor.py:89) at robot.model.visitor$py.call_function(C:/Users/hifi/git/robotframework/build/Lib/robot/model/visitor.py) at robot.model.testsuite$py.visit$21(C:/Users/hifi/git/robotframework/build/Lib/robot/model/testsuite.py:174) at robot.model.testsuite$py.call_function(C:/Users/hifi/git/robotframework/build/Lib/robot/model/testsuite.py) at robot.run$py.main$3(C:/Users/hifi/git/robotframework/build/Lib/robot/run.py:452) at robot.run$py.call_function(C:/Users/hifi/git/robotframework/build/Lib/robot/run.py) at robot.utils.application$py._execute$10(C:/Users/hifi/git/robotframework/build/Lib/robot/utils/application.py:94) at robot.utils.application$py.call_function(C:/Users/hifi/git/robotframework/build/Lib/robot/utils/application.py) at robot.utils.application$py.execute_cli$5(C:/Users/hifi/git/robotframework/build/Lib/robot/utils/application.py:49) at robot.utils.application$py.call_function(C:/Users/hifi/git/robotframework/build/Lib/robot/utils/application.py) at robot.run$py.run_cli$7(C:/Users/hifi/git/robotframework/build/Lib/robot/run.py:492) at robot.run$py.call_function(C:/Users/hifi/git/robotframework/build/Lib/robot/run.py) at robot.jarrunner$py._run$3(C:/Users/hifi/git/robotframework/build/Lib/robot/jarrunner.py:67) at robot.jarrunner$py.call_function(C:/Users/hifi/git/robotframework/build/Lib/robot/jarrunner.py) at robot.jarrunner$py.run$2(C:/Users/hifi/git/robotframework/build/Lib/robot/jarrunner.py:60) at robot.jarrunner$py.call_function(C:/Users/hifi/git/robotframework/build/Lib/robot/jarrunner.py) at org.robotframework.RobotRunner.run(RobotRunner.java:77) at org.robotframework.RobotFramework.run(RobotFramework.java:61) at org.robotframework.RobotFramework.main(RobotFramework.java:35) Caused by: java.lang.IllegalArgumentException: argument type mismatch at org.robotframework.javalib.reflection.KeywordInvoker.invoke(KeywordInvoker.java:63) ... 237 more

Thank you.

Hi-Fi commented 3 years ago

Actually there is version that has based on the latest javalib-core. It was made already over a year ago, but it's not in develop yet as it bases on Selenium4, which is still in Alpha...

That's also a reason why there isn't Selenium3 version in the Maven central with the groupID according repo's current location.

Best option would be, if Selenium4 version would work for you. It can be taken to use with following dependency:

<dependency>
    <groupId>com.github.marketsquare</groupId>
    <artifactId>robotframework-seleniumlibrary</artifactId>
    <version>4.0.0-alpha-4.1</version>
    <scope>test</scope>
</dependency>

There has been 3 more Alphas after that, but if that work for you, I think the selenium4 branch can be updated to latest dependencies and published.

Otherwise selenium3 version needs PR with all updated dependencies, and release with even longer version (as you see, the last versions have followed same pattern as Selenium itself, approximation of pi).

boog1ebug commented 3 years ago

Thank you very much for the answer. I was mainly interested in Selenium3 stable version. I guess have to wait then. Good to see that this is still maintained!

Hi-Fi commented 3 years ago

It's apparently not so easy thing to get either of versions aligned. Javalibcore 2 makes quite big changes to keyword handling, so redoing those to Selenium 3 version is a bit painfull. But same time noticed that because of the age there're also changes in Selenium 3 version that should be in Selenium 4.

Selenium 3's last version is over 2 years old already, which makes it a bit annoying to update it. But because of slowness with Selenium 4, maybe it needs to be done, including

php-coder commented 3 years ago

Javalib-core update also will fix https://github.com/MarketSquare/robotframework-httprequestlibrary/issues/62

Hi-Fi commented 2 years ago

Selenium 4 is currently at RC, so I think there's not point of trying to make Selenium 3 version and struggling (again) with rebase of develop to Selenium4 branch.

I think this isn't blocking issue, as otherwise there probably would have been PR about this already. As all the code is already available at the selenium4 branch.