Experience & exploration about software QA tools & techniques. Maintaining & writing blog posts on qavalidation.com! Publishing video tutorials on youtube.com/qavbox

Introducing FirefoxOptions for selenium 3.x

From selenium 3.0 beta 4, selenium introduced class FirefoxOptions to Manage firefox specific settings in a way gecko driver can understand. Let’s see how firefox settings we can use in selenium easily Before to selenium 3.0, used firefox profile as FirefoxProfile profile= new FirefoxProfile(); profile.setPreference(“browser.startup.homepage”,”http://qavalidation.com”); profile.setAcceptUntrustedCertificates(true); DesiredCapabilities caps=DesiredCapabilities.firefox(); caps.setCapability(FirefoxDriver.PROFILE, profile); FirefoxDriver driver = new FirefoxDriver(caps); Now we can…

Convert part of string into char array in java – getchars(int, int, char[], int)

myStr.getChars(srcBeginIndex, srcEndIndex, dstCharArray, dstBeginIndex) is a java method which helps to get a part of the string into character array, this method accepts 4 parametes, This method doesn’t return any value, rather it copies the part of the string in to the character array specified in the third parameter. let’s see the implementation public static…

String to char in java- str.charat(index)

If you want to display or get any one character from a string, java provides a method .charAt(index) [this returns a character from the specified index], let’s see the implementation index should be with in the string length range, else will get exception java.lang.StringIndexOutOfBoundsException public static void main(String[] args) { String myStr = new String(“Welcome”);…

String to char array in java- str.tochararray()

If you want to convert a string into character array, java provides a method .toCharArray() [this returns a character array], let’s see the implementation public class CharString { public static void main(String[] args) { String myStr = new String(“Welcome”); char[] chars; System.out.println(“Individual characters – “); chars = myStr.toCharArray(); for(int i=0 ; i < chars.length ;…