GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Handle null arguments arriving as empty strings by psaikkonen · Pull Request #53 · eficode/JavaFXLibrary

Conversation

@psaikkonen

@psaikkonen psaikkonen commented Sep 24, 2020

Copy link
Copy Markdown
Contributor

Null values arrive as empty strings due to the jrobotremoteserver conversion between java and python. This caused the ClassCastException in issue #46 where the result of the first find is null and that is given as a root parameter for the next find. Instead of null the keyword receives an empty string and the runKeyword call fails since it can't be cast as a Parent object.

Now there's an additional check for null values in useMappedObject which replaces empty string arguments with null. This means you won't be able to provide an empty string as an argument for the library, but there should be no keywords where this would be necessary.

I also want to point out that the usage of combined find keywords described in the issue #46 still won't behave as expected there. When the first find now returns null and that is given as a root argument for the next execution of find keyword, the library will use the default value (since root argument is null) and instead look for matches everywhere. In this case the first call to find should have failIfNotFound set as true so the test execution would already fail when the first node can't be found, or use chained queries (see Locator syntax in the keyword documentation).

Also added tests for invalid root arguments and a more descriptive exception message when the java.lang.RuntimeException: java.lang.IllegalArgumentException: java.lang.ClassCastException@111abcde is thrown. Closes #46.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
psaikkonen added 2 commits September 23, 2020 14:25
@psaikkonen
Set empty string args as nulls, add message for IllegalArgumentException
726b52e
@psaikkonen
Merge branch 'development' of https://github.com/eficode/JavaFXLibrary …
845930b
…into null-args
@psaikkonen
psaikkonen requested a review from sampeson September 24, 2020 11:03
@sampeson

sampeson commented Sep 24, 2020

Copy link
Copy Markdown
Contributor

looks good to me

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sampeson sampeson closed this Sep 24, 2020
@sampeson sampeson reopened this Sep 24, 2020
@sampeson
sampeson merged commit dbce1c8 into development Sep 24, 2020
@psaikkonen
psaikkonen deleted the null-args branch September 28, 2020 06:01
sampeson added a commit that referenced this pull request Nov 2, 2020
@sampeson @psaikkonen
Development (#56)
d6817cf
* Set empty string args as nulls, add message for IllegalArgumentException (#53)

* wrap runKeyword to asyncFx so that JavaFX operations are done FX thread

* more asyncfx fixes, went through whole code base

* new wrapping to asyncfx thread

* additional rewrite to have all needed kw's wrapped in FX thread, output and error handling improvements

* handle null object properly, timeout to be generic kw timeout, handle separately wait until kws, kw output improvements

* fix hover related kw's

* waitUntilExists and waitUntilDoesNotExist improvements

* wait until keywords to have overall timeout value, improved printout

* fix text prefix to check for quotation marks

* fix text prefix to have support for apostrophe (') also

* cleanup

* fix verifiers hoverable kw's, add test

* fix push many times kw

* fix osx tests

* screenshots to asyncfx thread also in kw failure, fix hover kw's once more

* fix osx part and go throught documentation

* fix osx part and go throught documentation

* fix RunOnFailure to not store screenshot as mapObject to save memory

* remove comments

Co-authored-by: Pasi Saikkonen <[email protected]>
sampeson added a commit that referenced this pull request Nov 11, 2020
@sampeson @soisetu @psaikkonen
0.7.1 changes (#58)
629d976
* Experimental java agent support

JavaFXLibrary can now be attached to process as java agent.

* Fix docker-compose up

Building the docker demo failed because of missing package versions for
the newer Ubuntu image. Base image of the demo is now fixed to bionic
tag since Ubuntu updates have broken the build earlier as well.
Related Launchpad ticket:
https://bugs.launchpad.net/ubuntu/+source/openjfx/+bug/1799946

* Updated documentation (java agent)

* Add possibility to configure different directory for log.html in Set Screenshotdir, fixes #17

* java agent documentation fix

* Set Classpath failure as warnings and add failIfNotFound argument

* Use asyncFx for helperfunctions methods, remove waitForFxEvents usage, failure printout improvements

* remove deprecated keywords and methods (enhancement #11)

* Set empty string args as nulls, add message for IllegalArgumentException (#53)

looks good to me

* Development kw asyncfx wrap (#55)

* wrap runKeyword to asyncFx so that JavaFX operations are done FX thread

* more asyncfx fixes, went through whole code base

* new wrapping to asyncfx thread

* additional rewrite to have all needed kw's wrapped in FX thread, output and error handling improvements

* handle null object properlty, timeout to be generic kw timeout, handle separately wait until kws, kw output improvements

* fix hover related kw's

* waitUntilExists and waitUntilDoesNotExist improvements

* wait until keywords to have overall timeout value, improved printout

* fix text prefix to check for quotation marks

* fix text prefix to have support for apostrophe (') also

* cleanup

* fix verifiers hoverable kw's, add test

* fix push many times kw

* fix osx tests

* screenshots to asyncfx thread also in kw failure, fix hover kw's once more

* fix osx part and go throught documentation

* fix osx part and go throught documentation

* fix RunOnFailure to not store screenshot as mapObject to save memory

* remove comments

* fix moveTo keyword to use asyncFx thread, fixes #57

* fix scroll keywords to do one tick at time from main thread, fix related tests

* fix moveTo in osx also

Co-authored-by: Turo Soisenniemi <[email protected]>
Co-authored-by: Pasi Saikkonen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@sampeson sampeson Awaiting requested review from sampeson

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@psaikkonen @sampeson
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.