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

RollupManager - args Object Array will now work also with Java1.8.51+ #168

Closed
wants to merge 1 commit into from

Conversation

tommnyno23
Copy link

When adding a rollup rule, nasshorn was not able to parse args object arrays.
On Java versions 1.8.51+ it was throwing an exception (Lower 1.8 versions were fine):

java.lang.ClassCastException: key should be a String. It is java.lang.Integer instead.
        at jdk.nashorn.api.scripting.ScriptObjectMirror.checkKey(ScriptObjectMirror.java:885)
        at jdk.nashorn.api.scripting.ScriptObjectMirror.get(ScriptObjectMirror.java:382)
        at jp.vmi.script.JSList$JSMapList.get(JSList.java:37)
        at java.util.AbstractList$Itr.next(AbstractList.java:358)
        at jp.vmi.selenium.rollup.RollupManager.addRollupRule(RollupManager.java:55)

This is the javascript (was failing on args array):

manager.addRollupRule({
    name: "spot_type",
    description: "Sets value 'text' to 'element'",
    args: [{
        name: "text",
        description: "Text value"
    }, {
        name: "element",
        description: "Element locator"
    }],
    commandMatchers: [],
    getExpandedCommands: function(args) {
        var commands = [];

        commands.push({
            command: "waitForElementPresent",
            target: args.element
        });
        commands.push({
            command: "type",
            target: args.element,
            value: args.text
        });

        return commands;
    }
});

With this commit the issue is fixed. It works for 1.8.51+ Java versions.

@vmi vmi added this to the 2.1.0 milestone Nov 11, 2015
@vmi vmi added the bug label Nov 11, 2015
@vmi vmi self-assigned this Nov 11, 2015
@vmi vmi mentioned this pull request Nov 15, 2015
@vmi
Copy link
Owner

vmi commented Nov 15, 2015

Hi,

Thanks for your P.R.
However, it looks not good.
I fixed the problem by a different way. (#170)
Please test it.

@tommnyno23
Copy link
Author

I've just tested, and it works.
Thanks for the fix !

@vmi vmi closed this Nov 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants