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

Improved warnings if using Pages and input names are 'reserved/inuse' words #122

Closed
geb-bot opened this issue Oct 7, 2011 · 1 comment
Closed
Assignees
Milestone

Comments

@geb-bot
Copy link

geb-bot commented Oct 7, 2011

Originally created by Paul King.

If you have some html like this:

<form name='post' ...>
    <input type='text' name='title' />
    ...

Then trying to have a Page object with the following:

title { $("form").title() }

Will get confused by 'title' as the accessor for getting the browser title. Also, 'content' and possibly others ('at', 'url' not tested).

The workaround is to just use another name but it would be nice if you received a better error message or warning. Currently you receive:
{noformat}
groovy.lang.MissingMethodException: No signature of method: java.lang.String.value() is applicable for argument types: (java.lang.String)
{noformat}

@geb-bot
Copy link
Author

geb-bot commented Apr 11, 2012

Originally posted by Luke Daley.

We need to have a list of �reserved words� and consult them when parsing the content DSL to fail fast with a nice warning.

We could generate the list by reflecting on the Browser and Page classes, though there would be a performance cost. We might better generating the list and saving as a static data structure.

@geb-bot geb-bot added this to the 0.10.1 milestone Apr 12, 2015
@erdi erdi modified the milestone: 0.10.1 Jul 11, 2015
@erdi erdi added this to the 1.0 milestone Dec 25, 2015
@erdi erdi self-assigned this Dec 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants