Jump to content

HTML form


Giri N

Recommended Posts

when I run below HTML code in hackerrank, it is showing below error. Please help with this.


 

__________________________ TestWebpage.test_indexpage __________________________

self = <test_webpage.TestWebpage object at 0x7f6dd8e58b70>

def test_indexpage(self):

assert self._index.find_all('form')

assert self._index.body.h1.string=='Registration Form'

site = self._index.find('form')

assert self._index.find('form')

site1 = site.find_all('input')

count = 0

for input in site1:

count +=1

> assert count==6

E assert 5 == 6

test/test_webpage.py:23: AssertionError

============================== 1 failed in 0.13s ============================

<!DOCTYPE html>
<html>
  <head>
    <link rel="icon" href="favicon.png" type="image/png">
    <title>Destiny</title>
    <link href="mystyle.css" rel="stylesheet" type="text/css">
  </head>
  <body>
    <header>
      <h1>Registration Form</h1>
    </header>
    <form>
      <div id="container">
        <table>
          <tr>
            <td><label for="fname">Name:</label></td>
            <td><input type="text" id="fname" name="fname"></td>
          </tr>
          <tr>
            <td><label for="dob" >Date of Birth:</label></td>
            <td><input type="text" id="dob" name="dob" placeholder="dd/mm/yyy"></td>
          </tr>
          <tr>
            <td><label for="country">Country:</label></td>
            <td><input list="country" id="count" name="count" ></td>
            <datalist id="country">
              <option value="India">
              <option value="United States">
              <option value="United Kingdom">
              <option value="Australia">
              <option value="France">
            </datalist>
          </tr>
          <tr>
            <td><label for="mail">Email:</label></td>
            <td><input type="email" id="email" name="email"></td>
          </tr>
          <tr>
            <td><label for="website">Website:</label></td>
            <td><input type="url" id="website" name="website"></td>
          </tr>
        </table>
      </div>
    </form>
    <button type="button">Submit</button>
  </body>
</html>

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...