Monday, March 14, 2016

Choosing the right method for testing the mobile web app

Everyone is focusing more on their mobile web with the growing traffic from mobile devices and with that there is more focus on mobile testing. There are many techniques available in the market today to carry out activities on the mobile phone which are:

1.       Test Emulators – They will open up a device like environment right in your desktop system so that you can test without buying a real device. There are many such Emulators available in the market one the most famous is GenyMotion, Blue Stacks, etc
Cons:
a.       You might need high end system to run multiple devices side by side
b.      You might not able to simulate exact user behavior based on touch events

2.       Use chrome/Firefox in emulation mode – This involves opening up your desktop browser in the emulation mode so that it acts like a mobile web browser and send requests/response accordingly. You can refer to below mentioned links to know more about how to use the browsers in emulation mode.
Cons:
a.       Sometimes we cannot predict the behavior which might differ on the real devices
b.      Cannot simulate OS specific behaviors
3.       Use real devices: This is the best approach as nothing gives you more realistic results than a real device but accessing a test environment on a device is a really tricky thing to do, since whenever you hit a domain name on a device, it will take you to your production server unless you have done host mappings and editing host file on a device requires lots of steps to be done. There are other approaches available for the same and you can refer to my post for more details.
Cons:
a.       Costly way of doing testing

Wednesday, October 7, 2015

Password retrieval from Heidi SQL


In case you forget your MySQL login then you can retrieve it in case you use Heidi SQL to connect with MySQL server and your password is stored in its settings.

You have to follow steps as listed below:
1. Go to File  ==> Export settings to dump all settings in a file
2. Open up the file in a text editor e.g. notepad
3. Look for your server name in the file
4. Your user name and password would be listed as 
  •  Servers\serverName\User<|||>1<|||>username
  •  Servers\serverName\Password<|||>1<|||>75453A3A7C7477695 
5. Now you have received your password but it is in encoded form and hence, can not be used directly. Use below mentioned JS to decode
function heidiDecode(hex) {
  var str = '';
  var shift = parseInt(hex.substr(-1));
  hex = hex.substr(0, hex.length - 1);
  for (var i = 0; i < hex.length; i += 2)
  str += String.fromCharCode(parseInt(hex.substr(i, 2), 16) - shift);
  return str;
}
document.write(heidiDecode('75453A3A7C7477695')); 
Just replace code in the last line of JS with your encoded password and run it in your browser console. You will get your password.

Monday, February 9, 2015

Localstorage size limitations




We have started relying highly on localstorage and are storing lots of data in localstorage. However, it also has a limit beyond that it would not work and would request data from server directly for each request.

Defaults:
Default value of storage capacity can be viewed as below:

Firefox - 
1. In the URL type about:config
2. Search for dom.storage.default_quota in the config parameters. You will find value as 5120 which will translate to 5MB

Chrome  -
Limit is listed as 5MB on Chrome specs

IE - 
The limit is listed as 10MB on IE Specs


Current usage check
You can check current usage of localstorage by running following javascript in the browser console:
var total = 0;for(var x in localStorage) {  var amount = (localStorage[x].length * 2) / 1024 / 1024;  total += amount;  console.log( x + "=" + amount.toFixed(2) + " MB");}console.log( "Total: " + total.toFixed(2) + " MB");


Here is some javascript code to find the size of your localstorage http://jsfiddle.net/b31gzjys/2/
During my research I found this blog very helpful- Dom storage 


  

Tuesday, November 4, 2014

Unprotect an excel sheet without password... solved

If an excel sheet is marked as protected then you will not be able to modify many of the cells in the sheet and the sheet could be password protected as well. So, here is a trick which will help you to unprotect an excel sheet without entering password.

Step #1: Press ALT +  F11 or click on View Code in Developers Tabs



Step #2: From left panel at project panel double click on the sheet name which you want to unprotect


Step #3: In the White Space Enter the below Code. Do not change the code just copy paste:



Code:
Sub PasswordBreaker()
    'Breaks worksheet password protection.
    Dim i As Integer, j As Integer, k As Integer
    Dim l As Integer, m As Integer, n As Integer
    Dim i1 As Integer, i2 As Integer, i3 As Integer
    Dim i4 As Integer, i5 As Integer, i6 As Integer
    On Error Resume Next
    For i = 65 To 66: For j = 65 To 66: For k = 65 To 66
    For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66
    For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66
    For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126
    ActiveSheet.Unprotect Chr(i) & Chr(j) & Chr(k) & _
        Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _
        Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
    If ActiveSheet.ProtectContents = False Then
        MsgBox "One usable password is " & Chr(i) & Chr(j) & _
            Chr(k) & Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & _
            Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
         Exit Sub
    End If
    Next: Next: Next: Next: Next: Next
    Next: Next: Next: Next: Next: Next
End Sub

Step #4 Now Click on the Run Button or press F5:


And pufff.. sheet is unprotected for you now. Also you would be getting a message in the pop up window.
This Message is contains the password which can be used to unprotect the other sheets in the same workbook.