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

Form fields not recognized correctly #36

Open
christianschneider89 opened this issue Nov 22, 2019 · 3 comments
Open

Form fields not recognized correctly #36

christianschneider89 opened this issue Nov 22, 2019 · 3 comments
Labels

Comments

@christianschneider89
Copy link

christianschneider89 commented Nov 22, 2019

On the URL https://www.postfinance.ch/ap/ba/fp/html/e-finance/home?login the form is not recognized correctly.
As you can see in the screenshot locust recognizes the second and the third field.
The first two fields are mandatory, the third is optional.

image

@situplastik
Copy link

Looking the HTML, the not recognized input is:
<input name="p_username" class="text_input--field" id="text_input_narrow-u4" placeholder="" type="text" value="" maxlength="23" autocomplete="off" data-bcup-score="10">

Here another page where locust doesn't recognize correctly:
https://admin.cdmon.com/en/access

Captura de Pantalla 2020-03-31 a les 11 01 56

Looking the HTML, the input fragment is:
<input name="dades[usuario]" id="usuario" autofocus="true">

Regarding the repo structure, I guess that the solution is to add some lines in testing scripts: https://github.com/buttercup/locust/blob/master/source/inputs.js#L5

@perry-mitchell , Shall I do a PR adding name="p_username" and id="usuario" ??

Thanks for all buttercup environment!

@perry-mitchell
Copy link
Member

Hi @situplastik - Thanks for the detailed report, and sorry on the huge delay. Has been a busy Q1 for me.

The issue here is that the detection is imperfect, of course, but one aspect of this is that it relies currently on language-specific terms like username and password. Having this functionality internationalised would be a nightmare.. so I'm not entirely sure of the best way to move forward here. There's no standard way to build a login/registration form, so there's nothing to lean on here. We could try to set an example here by allowing internationalised form detection, but then I think we'd better redesign the detection method to allow for simpler transation support of keywords into all languages. Any suggestions on this point are very welcome.

@situplastik
Copy link

Hi @perry-mitchell , don't worry about the delay, sometimes is hard to find a good moment to spend with ;)

Yes, I totally agree with you and the solution must be as easy and maintainable possible.

To solve the @christianschneider89 initial issue, a non-complex solution would be to edit regex testing with "%LIKE%" before & after "username" as /name=".*username.*"/ . I'm not really confident with REGEX expression, so maybe someone with more acknowledge must review it.
That solution would solve as well if some input have a array field as name="data[username]".

Looking my example, no good idea (beside your suggestion of doing some i18n detection structure) appear in my mind... Maybe if a form only have 2 fields and the second field pass the password check, locust could presume that the other field is an username, but I'm quite sure that the cure will be worse than the disease... many bugs or non-expected results could be appear :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants