Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Textfield Value Should Be" fails with NPE on input type=url #52

Closed
php-coder opened this issue Aug 20, 2018 · 6 comments
Closed

"Textfield Value Should Be" fails with NPE on input type=url #52

php-coder opened this issue Aug 20, 2018 · 6 comments

Comments

@php-coder
Copy link

The issue is the same as MarkusBernhardt/robotframework-selenium2library-java#92:

The keyword Textfield Value Should Be fails with NullPointerException, when it's used for getting a value from the <input type=url>:

20180820 18:47:32.848 - FAIL - RuntimeException
20180820 18:47:32.848 - DEBUG - java.lang.RuntimeException
        at org.robotframework.javalib.library.AnnotationLibrary.retrieveInnerException(AnnotationLibrary.java:148)
        at org.robotframework.javalib.library.AnnotationLibrary.runKeyword(AnnotationLibrary.java:130)
        at com.github.markusbernhardt.seleniumlibrary.SeleniumLibrary.runKeyword(SeleniumLibrary.java:499)
        at robot.model.testcase$py.visit$7(/home/peke/Devel/robotframework/build/Lib/robot/model/testcase.py:74)
        at robot.model.testcase$py.call_function(/home/peke/Devel/robotframework/build/Lib/robot/model/testcase.py)
        at robot.model.itemlist$py.visit$11(/home/peke/Devel/robotframework/build/Lib/robot/model/itemlist.py:75)
        at robot.model.itemlist$py.call_function(/home/peke/Devel/robotframework/build/Lib/robot/model/itemlist.py)
        at robot.model.visitor$py.visit_suite$2(/home/peke/Devel/robotframework/build/Lib/robot/model/visitor.py:88)
        at robot.model.visitor$py.call_function(/home/peke/Devel/robotframework/build/Lib/robot/model/visitor.py)
        at robot.model.testsuite$py.visit$19(/home/peke/Devel/robotframework/build/Lib/robot/model/testsuite.py:161)
        at robot.model.testsuite$py.call_function(/home/peke/Devel/robotframework/build/Lib/robot/model/testsuite.py)
        at robot.model.itemlist$py.visit$11(/home/peke/Devel/robotframework/build/Lib/robot/model/itemlist.py:75)
        at robot.model.itemlist$py.call_function(/home/peke/Devel/robotframework/build/Lib/robot/model/itemlist.py)
        at robot.model.visitor$py.visit_suite$2(/home/peke/Devel/robotframework/build/Lib/robot/model/visitor.py:88)
        at robot.model.visitor$py.call_function(/home/peke/Devel/robotframework/build/Lib/robot/model/visitor.py)
        at robot.model.testsuite$py.visit$19(/home/peke/Devel/robotframework/build/Lib/robot/model/testsuite.py:161)
        at robot.model.testsuite$py.call_function(/home/peke/Devel/robotframework/build/Lib/robot/model/testsuite.py)
        at robot.model.itemlist$py.visit$11(/home/peke/Devel/robotframework/build/Lib/robot/model/itemlist.py:75)
        at robot.model.itemlist$py.call_function(/home/peke/Devel/robotframework/build/Lib/robot/model/itemlist.py)
        at robot.model.visitor$py.visit_suite$2(/home/peke/Devel/robotframework/build/Lib/robot/model/visitor.py:88)
        at robot.model.visitor$py.call_function(/home/peke/Devel/robotframework/build/Lib/robot/model/visitor.py)
        at robot.model.testsuite$py.visit$19(/home/peke/Devel/robotframework/build/Lib/robot/model/testsuite.py:161)
        at robot.model.testsuite$py.call_function(/home/peke/Devel/robotframework/build/Lib/robot/model/testsuite.py)
        at robot.model.itemlist$py.visit$11(/home/peke/Devel/robotframework/build/Lib/robot/model/itemlist.py:75)
        at robot.model.itemlist$py.call_function(/home/peke/Devel/robotframework/build/Lib/robot/model/itemlist.py)
        at robot.model.visitor$py.visit_suite$2(/home/peke/Devel/robotframework/build/Lib/robot/model/visitor.py:88)
        at robot.model.visitor$py.call_function(/home/peke/Devel/robotframework/build/Lib/robot/model/visitor.py)
        at robot.model.testsuite$py.visit$19(/home/peke/Devel/robotframework/build/Lib/robot/model/testsuite.py:161)
        at robot.model.testsuite$py.call_function(/home/peke/Devel/robotframework/build/Lib/robot/model/testsuite.py)
        at robot.run$py.main$3(/home/peke/Devel/robotframework/build/Lib/robot/run.py:452)
        at robot.run$py.call_function(/home/peke/Devel/robotframework/build/Lib/robot/run.py)
        at robot.utils.application$py._execute$10(/home/peke/Devel/robotframework/build/Lib/robot/utils/application.py:94)
        at robot.utils.application$py.call_function(/home/peke/Devel/robotframework/build/Lib/robot/utils/application.py)
        at robot.utils.application$py.execute_cli$5(/home/peke/Devel/robotframework/build/Lib/robot/utils/application.py:49)
        at robot.utils.application$py.call_function(/home/peke/Devel/robotframework/build/Lib/robot/utils/application.py)
        at robot.run$py.run_cli$7(/home/peke/Devel/robotframework/build/Lib/robot/run.py:489)
        at robot.run$py.call_function(/home/peke/Devel/robotframework/build/Lib/robot/run.py)
        at robot.jarrunner$py._run$3(/home/peke/Devel/robotframework/build/Lib/robot/jarrunner.py:64)
        at robot.jarrunner$py.call_function(/home/peke/Devel/robotframework/build/Lib/robot/jarrunner.py)
        at robot.jarrunner$py.run$2(/home/peke/Devel/robotframework/build/Lib/robot/jarrunner.py:57)
        at robot.jarrunner$py.call_function(/home/peke/Devel/robotframework/build/Lib/robot/jarrunner.py)
        at org.robotframework.RobotRunner.run(RobotRunner.java:74)
        at org.robotframework.RobotFramework.run(RobotFramework.java:61)
        at org.robotframework.mavenplugin.AcceptanceTestMojo.executeRobot(AcceptanceTestMojo.java:73)
        at org.robotframework.mavenplugin.AcceptanceTestMojo.subclassExecute(AcceptanceTestMojo.java:68)
        at org.robotframework.mavenplugin.AbstractMojoWithLoadedClasspath.execute(AbstractMojoWithLoadedClasspath.java:53)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:954)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:192)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.lang.NullPointerException
        at com.github.markusbernhardt.seleniumlibrary.keywords.FormElement.textfieldValueShouldBe(FormElement.java:504)
        at com.github.markusbernhardt.seleniumlibrary.keywords.FormElement.textfieldValueShouldBe(FormElement.java:479)
        at org.robotframework.javalib.reflection.KeywordInvoker.invoke(KeywordInvoker.java:50)
        at org.robotframework.javalib.beans.annotation.AnnotationKeywordExtractor$1.execute(AnnotationKeywordExtractor.java:62)
        at org.robotframework.javalib.beans.annotation.AnnotationKeywordExtractor$2.execute(AnnotationKeywordExtractor.java:86)
        at org.robotframework.javalib.library.KeywordFactoryBasedLibrary.runKeyword(KeywordFactoryBasedLibrary.java:37)
        at org.robotframework.javalib.library.AnnotationLibrary.runKeyword(AnnotationLibrary.java:128)
        ... 227 more
20180820 18:47:32.848 - INFO - +----- END KW: SeleniumLibrary.Textfield Value Should Be (41)
@Hi-Fi
Copy link
Collaborator

Hi-Fi commented Aug 21, 2018

What version you were using? Those lines doesn't seem to be matching at least the latest one.

Same issue still seems to be in later version, as it assumes that elements is always found with the value. But that error shouldn't be coming if the locator of the element is correct.

@php-coder
Copy link
Author

What version you were using?

2.53.1.1

@php-coder php-coder reopened this Aug 21, 2018
@Hi-Fi
Copy link
Collaborator

Hi-Fi commented Aug 21, 2018

There was clear issue at the code (comes from the original logic of method that gets the value), but has to check if the fix should be done to that method all places using it (as that method is also keyword).

Quite probably that version is not going to be updated, as Selenium 2 has been replaced with Selenium 3 almost from the beginning of this fork.

@php-coder
Copy link
Author

Thanks!

I'll check it again after migrating to Selenium 3 and report back.

@php-coder
Copy link
Author

I'll check it again after migrating to Selenium 3 and report back.

I've tried to roll back my workaround and tests started to fail, so the issue is still here. I tested on 3.141.59.2653

@Hi-Fi Hi-Fi closed this as completed in 4a911cb Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants