I want appium to run or execute my trigger randomly while the testing is going on!

I want to test a app for crash management when the testing is on the work it should randomly press home button and open the from the appswitch. I can’t use static function calling.

You are talking about a specific type of testing called monkey testing. I don’t think Appium is really built for this. You don’t give the platform you are working on, so you may want to do a search for ‘monkey testing <platform>’. Here is one for iOS:

Thanks @wreed I will surely look into it.