Hello everyone
I need some help with my code. I wanna log in a site with a pre-registered account. Using email adress and password. My codes work fine on each web site except fort his form. When I filled required fields and submit form either with command or clicking with mouse manuelly, it doesnt let me sign in. Page produces no errors, just refreshes page, coming email and password field empty again.
This is my code:
wbdriver.Start "chrome", "https://www.sitename.com "
wbdriver.Get "/"
wait (5) ‘ function to wait for some seconds
wbdriver.FindElementById("email").SendKeys (mail): wait (2)
wbdriver.FindElementById("password").SendKeys (password): wait (2
wbdriver.FindElementById("loginButton").Click
And this is the form I have trouble with:
<form id="loginForm" class="well form-horizontal" action="https://www.sitename.com/login" method="post">
<div class="inputField ">
<input type="text" id="email" name="email" value="" autocomplete="off"
data-validation="required email" data-maxlength="48" maxlength="48"
data-required-message="Please write your email." required tabindex="1"/>
<label for="email">
E-mail address
</label>
<div class="errorMessage" data-errormessagefor="email">
<div class="errorText"></div>
</div>
</div>
<div class="inputField ">
<input type="password" name="password" id="password" autocomplete="off"
data-validation="required minlength maxlength" data-minlength="6" data-maxlength="15" required tabindex="2"/>
<label for="password">
Password
</label>
<div class="showPass">Show it</div>
<div class="errorMessage" data-errormessagefor="password">
<div class="errorText"></div>
</div>
</div>
<div class="inputfield loginSection">
<span id="forgotPassword" class="forgotPassword" tabindex="4">Forgat Password</span>
<div class="checkbox">
<input type="checkbox" id="rememberMe" name="rememberMe" tabindex="3"/>
<label class="rememberMe" for="rememberMe" type="checkbox">
Remember me
</label>
</div>
</div>
<div id="loginButton" class="green_flat">Sign in</div>
<input type="hidden" id="returnUrl" name="returnUrl" value=""/>
</form>
So what may be the cause, anyone to help?
Hi Jack,
If you cannot login manually, the answer is in the site, you have to contact them.