Skip to content

Instantly share code, notes, and snippets.

Created August 5, 2016 18:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/38636a16590d7399fb7cecb8270e4479 to your computer and use it in GitHub Desktop.
Save anonymous/38636a16590d7399fb7cecb8270e4479 to your computer and use it in GitHub Desktop.
require 'watir-webdriver'
b = Watir::Browser.new
b.goto 'https://www.hudforeclosed.com/Membersite/'
b.execute_script("$('#username').val($.trim($('#username').val()));if($('#username').val().search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)==-1){$('#username').focus();alert('Your username should be the email address you registered with.');return false}else if($('#password').val()==''){$('#password').focus();alert('Password is required.');return false}else if($('#token').val()==''){return false}else{$('#login-form button').attr('disabled','disabled')}return true;")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment