I am trying to set text but it doesn't contain id, and class is same as of password.
<form>
<div class="form-group">
<input type="email"
placeholder="[email protected]" class="login-form-control"> </div>
<div class="form-group">
<input type="password" placeholder="password" class="login-form-
control">
</div>
</form>
You could use the difference in the type attribute to locate the fields:
browser.text_field(type: 'email').set('user')
browser.text_field(type: 'password').set('password')
If there are other email/password fields on the page, you might need to be more specific - eg combine with the class attribute:
browser.text_field(type: 'email', class: 'login-form-control').set('user')
browser.text_field(type: 'password', class: 'login-form-control').set('password')
Another option would be to use the placeholder attribute:
browser.text_field(placeholder: '[email protected]').set('user')
browser.text_field(placeholder: 'password').set('password')