You've provided no code but I image the issue is related to the following
* You've got two password textboxes with no id's. This is fine but it makes it extremely hard to target
* You've got two password textboxes, 1 for login, 1 for registration. You've indicated in your comments you get the error on registration page saying the element is hidden. It is because it is targeting the first text box under login instead of the second one under registration
You don't indicate what language you are using selenium with so I'll provide my examples in C#
The way i see it, you've got two solutions
1) Add unique Id's to the two password textboxes that you have. ex: txt-login-pwd for the login screen and then txt-registration-pwd for the registration password modal window.
That way in selenium you can simply target it by doing
2) If you've got full control over this website I don't know why you wouldnt just add id's to the password textboxes but in the event you feel opposed to that, this is your other option which is entirely more work than simply adding Id's to your two password textboxes.
To see what i mean by the fact that you have to find something that makes your password textboxes unique which the only thing I see is type="password". You'll need to figure out the proper XPATH syntax for this.
Note, i'm typing this from memory so it may or may not compile but the code will point you in the right direction
var pwdTextBoxes = driver.FindElements(By.Xpath("//input[@type='password']"));
var count = pwdTextBoxes.Count();
At this point you'll see
should say 2. Thats because of your login/registration textboxes.
You'll need to know which index of the pwdTextBoxes list/array is for registration and login screen respectively. From there, you'll be able to targe the correct one.
var loginPwdTxtBox = pwdTextBoxes;
would be the login password textbox and then
var registrationPwdTxtBox = pwdTextBoxes;
points to the registration textbox and you can take whatever action on it that you need at that time.