Friday 19 December 2014

Popup appear/disappear with time gap

set objShell = createobject("wscript.shell")
objShell.Popup "Love u mom",2, "Kid says",64

Thursday 18 December 2014

QTP alert window styles

MsgBox "Hello there 0",0,"Greetings From csr"
MsgBox "Hello there 1",1,"Greetings From csr"
MsgBox "Hello there 2",2,"Greetings From csr"
MsgBox "Hello there 3",3,"Greetings From csr"
MsgBox "Hello there 4",4,"Greetings From csr"
MsgBox "Hello there 5",5,"Greetings From csr"
MsgBox "Hello there 16",16,"Greetings From csr"
MsgBox "Hello there 32",32,"Greetings From csr"
MsgBox "Hello there 64",64,"Greetings From csr"
MsgBox "Hello there 256",256,"Greetings From csr"
MsgBox "Hello there 512",512,"Greetings From csr"
MsgBox "Hello there 768",768,"Greetings From csr"


0
0x0
Show OK button.
1
0x1
Show OK and Cancel buttons.
2
0x2
Show Abort, Retry, and Ignore buttons.
3
0x3
Show Yes, No, and Cancel buttons.
4
0x4
Show Yes and No buttons.
5
0x5
Show Retry and Cancel buttons.
6
0x6
Show Cancel, Try Again, and Continue buttons.
16
0x10
Show "Stop Mark" icon.
32
0x20
Show "Question Mark" icon.
48
0x30
Show "Exclamation Mark" icon.
64
0x40
Show "Information Mark" icon.
256
0x100
The second button is the default button.
512
0x200
The third button is the default button.
4096
0x1000
The message box is a system modal message box and appears in a topmost window.
524288
0x80000
The text is right-justified.
1048576
0x100000
The message and caption text display in right-to-left reading order, which is useful for some languages.
-1
The user did not click a button before nSecondsToWait seconds elapsed.
1
OK button
2
Cancel button
3
Abort button
4
Retry button
5
Ignore button
6
Yes button
7
No button
10
Try Again button
11
Continue button

Log files work

package Flowell_testing;

import java.io.IOException;
import java.util.logging.FileHandler;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;

public class log1File {

    /**
     * @param args
     */
    public static void main(String[] args) { 

        Logger logger = Logger.getLogger("MyLog"); 
        FileHandler fh; 

        try { 

            // This block configure the logger with handler and formatter 
            fh = new FileHandler("C:/Users/Youtility/Desktop/MyLogFile.log"); 
            logger.addHandler(fh);
            SimpleFormatter formatter = new SimpleFormatter(); 
           fh.setFormatter(formatter); 

            // the following statement is used to log any messages 
            logger.info("My first log"); 

        } catch (SecurityException e) { 
            e.printStackTrace(); 
        } catch (IOException e) { 
            e.printStackTrace(); 
        } 

        logger.info("Hi How r u?"); 

    }

}