---
# System prepended metadata

title: API Guide - Normal Type
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==

## Group Methods
1. **queryUserId**, path=API
    * Description: query the user Identifier
    * Return Value: the user Id of this TestDragon license.
2. **queryUserDict**, path=API
    * Description: query for the user data card as a python dict!
    * Return Value: the dict that contains everything about the projects and test data of the license user.
3. **queryRootDir**, path=API
    * Description: query the directory path of my InTOL TBots.
    * Return Value: the working directory path string that runs this TestDragon session.
4. **queryCacheDir**, path=API
    * Description: query the directory path of user temporal data cache of InTOL TBots.
    * Return Value: the working directory path string of user data. It is API.queryRootDir()//.TestDragonCache.
5. **getdummyObj**, path=API
    * Description: create a python dummy object that you can add attributes and methods.
    * Return Value: an empty object that the users may attach attributes and methods.
6. **checkPlatformPath**, path=API
    * Description: get path name string of the OS in consideration of the OS default encoding.
    * Arguments:
        1. *path*: a path string
    * Return Value: a string of the path compatible with the OS encoding.
7. **createWebDriver**, path=API
    * Description: create a web driver object
    * Arguments:
        1. *browserID*: either chrome, safari, opera, ie, chromium, or firefox.
        2. *browserProfileDirPath*: path to the browser profile setting.
        3. *browserConfig*: browser configuration object
        4. *auxChromeOptions*: a list of strings to add_argument().
        5. *downloadDir*: the path to the folder for saving browser downloads.
    * Return Value: a selenium web driver object.
8. **queryWebDriverDownloadDirPath**, path=API
    * Description: query the web browser download folder path
    * Return Value: the path name string of the folder where the browser saves downloadings if the app is a web app.
9. **clearWebDownloads**, path=API
    * Description: clear the web download folder in the PC or macbook.
    * Arguments:
        dirPath: the folder path of web download. The default path is defined in the web driver.
    * Return Value: a Boolean value indicating if the clearing succeeded.
10. **getWebDownloadContents**, path=API
    * Description: read all files in the web download folder and return them in a python dict. AFter the reading, cleaer the folder.
    * Return Value: a dict of all file contents in the web download directory. The keys are the file names in the directory.
11. **getPhpContainer**, path=API
    * Description: create and return a php container
    * Arguments:
        1. *containerName*: name of the container.
        2. *hostPort*: port of the container
    * Return Value: the created PHP container.
12. **queryHostIP**, path=API
    * Description: returns the host name of the current system under which the Python interpreter is executed.
    * Return Value: the host name of the current system under which the Python interpreter is executed.
13. **urlParse**, path=API
    * Description: get the subdomain and domain name of the url
    * Arguments:
        1. *url*: a url string
    * Return Value: a url analysis object with attributes for subdomain name, domain names, country names, etc.
14. **queryUrlDomain**, path=API
    * Description: get the domain of a url
    * Arguments:
        1. *url*: a url string
    * Return Value: a string for the domain of a url
15. queryUrlQueries, path=API
    * Description: get the query dict of a url
    * Arguments:
        1. *url*: a url string
    * Return Value: a dict for the queries in a url
16. **changeUrlParameterValues**, path=API
    * Description: construct a new url with manipulated parameter values
    * Arguments:
        1. *url*: a url string
        2. *parameterValues*: a dict for parameter values
    * Return Value: a url with manipulated parameter values
17. **queryCallReturnReport**, path=API
    * Description: query for the return report of the TBot that just exitted its execution.
    * Return Value: a return report from the just-finished TBot if any.
18. **getSuggestedTextByTopic**, path=API
    * Description: returns some texts according to the input topic.
    * Arguments:
        1. *topic*: any NLP topic that can be assumed by action elements in a screen dom.
    * Return Value: some text according to the input topic.
19. createLogger, path=API
    * Description: create a logger that TestDragon manages for me.
    * Arguments:
        1. *logFilePath*: the file location of the log. Default is in ./.TestDragonCache/logYYYYMMDDHHMMSS.txt
        2. *flags*: a list of control flags. Not used now.
    * Return Value: a logger object.
20. **enableMessageDump**, path=API
    * Description: resume message dumps to CMD.
21. **disableMessageDump**, path=API
    * Description: stop message dumps to CMD.
22. **printDictDepth**, path=API
    * Description: print a python dict up to a depth to the CMD.
    * Arguments:
        1. *d*: the python dict to print.
        2. *limit*: print depth. Default is 15.
23. **getRandomText**, path=API
    * Description: get a random string.
    * Arguments:
        1. *len*: the length of the random string. Default is 9.
    * Return Value: a random string.
24. **queryPlatform**, path=API
    * Description: get the OS name of TestDragon.
    * Return Value: the name of the OS.