Micro Focus QTP (UFT) Forums
Can we open a password protected zip file using QTP? - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Regular Expressions (https://www.learnqtp.com/forums/Forum-UFT-QTP-Regular-Expressions)
+--- Thread: Can we open a password protected zip file using QTP? (/Thread-Can-we-open-a-password-protected-zip-file-using-QTP)



Can we open a password protected zip file using QTP? - arunarora1990 - 06-28-2011

i have a password protected rar file
nd i dont knw password..

i want a run test..with dictionary word increment..like
a
ab
ac ad ae....aaa aab aac aad.......aba abb abc abd.....aca acb acc..

like upto 8 letter word..
if pword iz riight then it will open tht rar file..

so is its automation possible..?
becoz manually it takes more time..Sad[b][size=xx-small]


RE: do any 1 help..??? - tarun - 06-28-2011

Write down the dictionary words in an excel file, then import the excel as datatable sheet.
now write an action to enter the password taking one value from the data table at a time, put a Do loop to repeat this until valid password is entered.


RE: Can we open a password protected zip file using QTP? - rajpes - 07-03-2011

Password is unique, using regular expression concept for this doesnt make sense

'Just use looping

Code:
alphabets=array("a","b",......."z")



'8 for loops
  'for single letter check eg:a,b...z
for i=0 to 25
   pwd= alphabets(i)
     'use this pwd and check if it is correct password, if yes,print it and ExitTest
    
    'for 2 letters check eg:aa,ab....az
    for j=0 to 25
    pwd=alphabets(i)&alphabets(j)
    'use this pwd and check if it is correct password, if yes,print it and ExitTest
    next

    
    
    'for 3 letters check eg:aaa...aaz,aba..abz.....azz
    for j=0 to 25
        for k=0 to 25
        pwd=alphabets(i)&alphabets(j)&alphabets(k)
        'use this pwd and check if it is correct password, if yes,print it and ExitTest
        next
    next


   'for 4 letters check eg:aaaa........aaaz............azzz
    for j=0 to 25
        for k=0 to 25
            for l=0 to 25
                pwd=alphabets(i)&alphabets(j)&alphabets(k)&alphabets(l)
                'use this pwd and check if it is correct password, if yes,print it and ExitTest
                          next
                 next
         next

'
'
'
'Continue this pattern upto 8 letters
'
'
'
'



next