---
# System prepended metadata

title: API Guide - gAutoMan
tags: [Guide, API]

---

## Methods that TBot can call in getTestInput().
For query and control the app under test and system under test from inside the TBot execution.

==path=API.gAutoMan==

## Description
generalized automata group

## Group Methods
1. **queryGAutomata**, path=API.gAutoMan.queryGAutomata
	* Description: get the generalized automata.
	* Return Value: a list of all states in the generalized automata.
2. **queryCurrentStateGAutIndex**, path=API.gAutoMan.queryCurrentStateGAutIndex
	* Description: try add the current state to the generalized automata and return the gState index.
	* Return Value: the generalized state index of the current state. If the current state has never been added to the generalized automata, then an error message is returned.
3. **queryDomains**, path=API.gAutoMan.queryDomains
	* Description: get all semantic domain names of registered test traces.
	* Return Value: a list of all semantic domain names.
4. **queryPurposes**, path=API.gAutoMan.queryPurposes
	* Description: get all purpose names of registered test traces.
	* Return Value: a list of purpose names of registered traces.
5. **createGAut**, path=API.gAutoMan.createGAut
	* Description: create a generalized automata with the gAut specified as a python dict.
	* Arguments:
        1. *gAutoDict* : only TestDragon team members can play with their own gAuto definitio.
	* Return Value: a key for accessing the created generalized automata object.
6. **getMostSimilarGState**, path=API.gAutoMan.getMostSimilarGState
	* Description: get the most similar state in generalized automata.
	* Arguments:
        1. *domain* : the domain of this generalized state in registered traces
        2. *purpose* : the purpose of this generalized state in registered traces
        3. *gStateDomDict* : only TestDragon team members can play with this.
        4. *gAuto* : only TestDragon team members can play with their own gAuto definitio.
	* Return Value: a dict for a state in the generalized automata that is most similar to the current state.
7. **getMinDistance2Final**, path=API.gAutoMan.getMinDistance2Final
	* Description: get the minimal distance of the current most similar gState to a good final gState.
	* Arguments:
        1. *domain* : the domain of this generalized state in registered traces
        2. *purpose* : the purpose of this generalized state in registered traces
        3. *gStateDomDict* : only TestDragon team members can play with this.
        4. *gAutoKey* : a key returned by createGAut(). Only TBot with advanced development license can play with their own gAuto.
	* Return Value: an integer for the current minimum distance from the current gState to a good final gState. None if no good path to any good final gState.
8. **getNextMostSimilarGState**, path=API.gAutoMan.getNextMostSimilarGState
	* Description: get the next most similar state in generalized automata. This works as a loop iterator.
	* Arguments:
        1. *gAuto* : only TestDragon team members can play with their own gAuto definitio.
	* Return Value: a dict for a state in the generalized automata that is k'th similar to the current state of the app under test if the method has been called k times since the last call to getMostSimilarGState().
9. **getMostLikelyAction**, path=API.gAutoMan.getMostLikelyAction
	* Description: return action index and action python dict as deduced from the generalized automata.
	* Arguments:
        1. *domain* : the domain of this generalized state in registered traces
        2. *purpose* : the purpose of this generalized state in registered traces
        3. *gStateDomDict* : only TestDragon team members can play with this.
        4. *gAuto* : only TestDragon team members can play with their own gAuto definitio.
	* Return Value: an action in the legal action list.
10. **getNextMostLikelyAction**, path=API.gAutoMan.getNextMostLikelyAction
	* Description: return action index and action python dict as deduced from the generalized automata.
	* Arguments:
        1. *gAuto* : only TestDragon team members can play with their own gAuto definitio.
	* Return Value: an action in the legal action list.