localization

Hi

I have read the scripting for Localization and Multiple operating systems section of Using eggplant. With the understanding that I got, I am unable to proceed ahead with scripting.

If you could explain the same to me with an example given below, It would be of great help to me.

I have 2 Operating systems; say Windows 98 Japanese and windows XP English.

My Task is to follow the below steps to open a command prompt.
1. Click Start
2. Click Run
3. For Windows 98 Japanese, Type "command" in the run dialog "Open" and press Enter.
For Windows XP English, Type "cmd" in the run dialog "open" and press enter.

1. How do I use same script with different suites. ( I Understand that image name given for both OS should be same )
2. How do I use different function for step 3.
3. I would like to execute both suites one after the other. i.e. after windows Xp English suite, I shoul d execute Windows 98 Japanese.

I was actually got confused with using opensuite command. Please help me.

Even if you could explain with an example that is convenient to you which will make the concept clear to me, that is fine with me.

Thank you for your time.

Regards,
Ajay

Comments

  • Ajay,
    1. How do I use same script with different suites. ( I Understand that image name given for both OS should be same )

    Your main script will be located in it's own suite: main.suite.

    main.script

    Click "Start"
    Click "Run"


    The script above will utilize images that will be located in different suites. That is, one suite will contain the images for Windows 98(windows98.suite) and another suite will contain images for Windows XP (windowsxp.suite). When it comes time to run your script against a specific OS you will then need to open the appropriate suite via the openSuite command (pg 162 of the 'Eggplant Reference' manual). Your script should now look like this:

    // use images for windows xp
    openSuite "path/to/suite/for/windowsxp.suite"

    Click "Start"
    Click "Run"
    2. How do I use different function for step 3.

    The OpenCommand will be a custom handler that you will need to implement in each suite. That is, windowsxp.suite and windows98.suite.
    Opening the OS specific suite will then allow the master script to call upon the correct OpenCommand script/handler. You will then need to invoke this handler from the main script.

    openSuite "path/to/suite/for/windowsxp"

    Click "Start"
    Click "Run"

    OpenCommand


    // Opencommand.script in windowsxp.suite (english)
    TypeText "cmd", ENTER

    // Opencommand.script in windows98.suite (japanese)
    TypeText "command", ENTER
    3. I would like to execute both suites one after the other. i.e. after windows Xp English suite, I shoul d execute Windows 98 Japanese.

    You can accomplish this by writing additional scripts in your main suite that calls upon the main script. You can call these scripts windowsXPmain and windows98main.

    These scripts should look like:

    -- windowsXPmain.script

    // open the correct suite here
    openSuite "windowsxp"
    // establish connection here w/ correct info
    connect 'windowsXPBoxConnectionInfo'
    // invoke main behavior here
    main

    -- windows98main.script
    // open the correct suite here
    openSuite "windows98"
    // establish connection here w/ correct info
    connect 'windows98BoxConnectionInfo'
    // invoke main behavior here
    main

    Consult the 'Eggplant Reference' manual, page 158, for more information on establishing a connection within a script with the 'connect' command.
    Notice how I moved the openSuite command from the main.script to the platform specific main scripts. Your main should now look like:

    Click "Start"
    Click "Run"

    OpenCommand

    Now, if you want to run both platforms one after the other, you could have a master script in your main suite that says:

    --master.script
    runWithNewResults windowsXPmain
    runWithNewResults windows98main

    or you can just add the windowsxpmain and windows98main scripts to the schedules tab, and they should run one after the other.

    Hope that helps!
  • In addition, if it is not materially important to your test to actually click on the Start and Run images, then just use:

    TypeText WindowsDown, "r", WindowsUp

    Not 100% sure this works in Win98 as I don't have access to that OS at the moment. But this would potentially simplify part of your script.
  • Thank you this is very helpful.
Sign In or Register to comment.