Page tree
Skip to end of metadata
Go to start of metadata

Last updated: Aug 02, 2017 12:49

by Shir Konky

below is a code example on how to run the DummyTest on your application.
This example file is also part of github.

By default DummyTest will execute either 300 commands or 300 seconds. It means that the test will end once it reaches 300 gestures,

or exceeded 300 seconds if there's no exception. In case of an exception in device log, the test will end and a screenshot will be taken.
As a user you can set both execution time and number of gestures to your own values (see examples below).

in case the random actions reached an exception, you can easily reproduce by executing the same set of actions with the same seed

from previous execution. (see example5)


/**************************************
* Below is a sample of the usage of the dummyTest
*************************************/
        DummyTest dummyTest = new DummyTest(driver);
            
            //Option1: Use default values of 300 gestures or 300 seconds:
            if (dummyTest.dummyTest("Maps")){
                System.out.println("Found an Exception");
            }
            
            //Option2: limit dummy test to 30 gestures:
            if (dummyTest.dummyTest("Maps", 30)){
                System.out.println("Found an Exception");
            }
            //Option3: limit dummy test to 60 seconds:
            if (dummyTest.dummyTest("Maps", 60, TimeUnit.SECONDS)){
                System.out.println("Found an Exception");
            }
            
            //Option4: limit dummy test to either 10 commands or 60 seconds:
            if (dummyTest.dummyTest("Maps", 10, 60, TimeUnit.SECONDS)){
                System.out.println("Found an Exception");
            }
            
            //option 5: set a specific seed and execute the dummy test
            dummyTest.setRandomSeed(dummyTest.getRandomSeed());
            dummyTest.dummyTest("Maps");