Skip to main content

Posts

Showing posts from April, 2012

Integrated Auth with Selenium

In order to run Selenium with integrated auth you can create a Firefox profile in code and set your server as an NTLM auth trusted URI. // Setup Firefox profile to support integrated auth var profile = new FirefoxProfile ( ) ; profile . SetPreference ( " network.automatic-ntlm-auth.trusted-uris " , " localhost " ) ; profile . SetPreference ( " network.ntlm.send-lm-response " , true ) ; this . Driver = new FirefoxDriver ( profile ) ; // Set global wait timeout to 10 seconds this . Driver . Manage ( ) . Timeouts ( ) . ImplicitlyWait ( new TimeSpan ( 0 , 0 , 10 ) ) ; this . BaseUrl = new Uri ( " http://localhost/ " ) ; this . VerificationErrors = new StringBuilder ( ) ;

Range Validation with jQuery Validation Plugin

Sometimes you need to do client side validation based on other controls on the screen. Here is an example of how you can use the jQuery validation plugin to do dynamic range validation: < style type = " text/css " > label . error { color : red ; } < / style > < form id = " betweenForm " method = " post " action = " " > Change some values : < br / > < label for = " a " > Field min : < / label > < input id = " a " name = " a " type = " text " value = " 1 " / > < br / > < label for = " b " > Field max : < / label > < input id = " b " name = " b " type = " text " value = " 100 " / > < br / > < label for = " c " > Field between : < / label > < input id = " c " class = " required " name = ...