Tuesday, 7 August 2012

Simple Login (MonkeyTalk)


MonkeyTalk form:-

Input username EnterText test
Input password EnterText test
Button LOGIN tap %thinktime=3000
Button LOGOUT tap %thinktime=3000
Input username tap
Input username EnterText test1
Input password EnterText test1
Button LOGIN tap %thinktime=3000
Button LOGOUT tap %thinktime=3000
Input username tap
Input username EnterText test2
Input password EnterText test
Button LOGIN tap %thinktime=3000
Button LOGOUT tap %thinktime=3000

Javascript form:-

load("libs/<monkey_project_name>.js");
<monkey_project_name>. <script_name>.prototype.run = function() {
                this.app.input("username").enterText("test");
                this.app.input("password").enterText("test");
                this.app.button("LOGIN").tap({thinktime:"3000"});
                this.app.button("LOGOUT").tap({thinktime:"3000"});
                this.app.input("username").tap();
                this.app.input("username").enterText("test1");
                this.app.input("password").enterText("test1");
                this.app.button("LOGIN").tap({thinktime:"3000"});
                this.app.button("LOGOUT").tap({thinktime:"3000"});
                this.app.input("username").tap();
                this.app.input("username").enterText("test2");
                this.app.input("password").enterText("test");
                this.app.button("LOGIN").tap({thinktime:"3000"});
                this.app.button("LOGOUT").tap({thinktime:"3000"});
};

3 comments:

  1. awesome ..it wud help if u wud add the steps how to add js in the project ....as i m nt able to see javascrpt files in the samples

    ReplyDelete