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

splinter 0.7.7 breaks 0.7.5 functionality #595

Closed
sureshvv opened this issue Mar 22, 2018 · 4 comments
Closed

splinter 0.7.7 breaks 0.7.5 functionality #595

sureshvv opened this issue Mar 22, 2018 · 4 comments
Labels
Milestone

Comments

@sureshvv
Copy link
Contributor

sureshvv commented Mar 22, 2018

It seems buttons HAVE to be inside forms in 0.7.7.

Otherwise I get:

Traceback (most recent call last):
   File "/home/suresh/appt/myproject/appt/tests/test_blackout2.py", line 96, in test_delete
    browser.find_by_name('login').click()
  File "/home/suresh/appt/local/lib/python3.5/site-packages/splinter/driver/lxmldriver.py", line 397, in click
    return self.parent.submit_data(parent_form)
  File "/home/suresh/appt/local/lib/python3.5/site-packages/splinter/driver/djangoclient.py", line 121, in submit_data
    return super(DjangoClient, self).submit(form).content
  File "/home/suresh/appt/local/lib/python3.5/site-packages/splinter/driver/lxmldriver.py", line 74, in submit
    data = self.serialize(form)
  File "/home/suresh/appt/local/lib/python3.5/site-packages/splinter/driver/lxmldriver.py", line 48, in serialize
    form.remove(input)
  File "src/lxml/lxml.etree.pyx", line 950, in lxml.etree._Element.remove (src/lxml/lxml.etree.c:50799)
ValueError: Element is not a child of this node.
@andrewsmedina
Copy link
Member

it looks like a bug. I will try to reproduce it

@andrewsmedina andrewsmedina added this to the 0.8 milestone Apr 2, 2018
@andrewsmedina
Copy link
Member

@sureshvv can you add your html and the code that uses splinter to make possible to me reproduce this bug?

@andrewsmedina andrewsmedina modified the milestones: 0.8, 1.0 May 3, 2018
@sureshvv
Copy link
Contributor Author

sureshvv commented May 4, 2018

The html:

bug.zip

The code:

      from splinter import Browser
      browser = Browser('django')
      browser.visit('/login')
      browser.find_by_id('user-email').fill('jacob')
      browser.fill('password', 'top_secret')
      browser.find_by_name('login').click()

sureshvv pushed a commit to sureshvv/splinter that referenced this issue May 8, 2018
@sureshvv sureshvv mentioned this issue May 8, 2018
andrewsmedina pushed a commit that referenced this issue May 30, 2018
@blueyed
Copy link
Contributor

blueyed commented Jun 22, 2022

The problem here is basically that the element is not a direct child of the form.
But also note that the form should not get modified really, and there might be better methods. See #1059.

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