Thursday, 26 April 2018

Fiddler : App load testing at each layer

How to capture HTTPS traffic in Fiddler

Download Fiddler software: https://www.telerik.com/download/fiddler

Logo:






The software looks like:



No Configuration required to capture Web Requests in Fiddler.

Every browser Requests are captured by default.

BUT:
By default Fiddler doesn’t show the content of Web requests made to HTTPS Url (Secure site) because it's encrypted. Perform following steps if you want to see HTTPS Traffic.

- Launch Fiddler
- Go to Tools > Fiddler Options > HTTPS > Check [Decrypt Https Traffic Option]
- Once prompted accept certificate generated by Fiddler



To view compressed response in fiddler perform following steps.

- Click on the web request entry on left pane
- Click on the Inspector Tab > Click Transformer tab from bottom panel
- Click on transformer tab and select No compression option and then click Raw tab

Wednesday, 25 April 2018

Java Program : write a method to check if it is well formed expression. Eg: {[()]}

This question was asked in an interview that I found interesting.

Here you go.

I know, There are other ways to do it better.

                Map<Character, Character> exprssionMap = new HashMap<>();
exprssionMap.put('{', '}');
exprssionMap.put('[', ']');
exprssionMap.put('(', ')');

String inputExpression = "{[({{)}}]}";
int expressionLengh = inputExpression.length();
if (expressionLengh % 2 == 1) {
System.out.println("malformed Expression; Size of the Expression is not even                                           number");
} else {
for (int i = 0; i < expressionLengh / 2; i++) {
if (!exprssionMap.get(inputExpression.charAt(i))
.equals(inputExpression.charAt(expressionLengh - 1 - i))) {
System.out.println(
"Matching expression not found for: " +                                                                                                    inputExpression.charAt(i) + "; index:" + i);
}
}
}

Happy Coding.