### Example Ubuntu 22.04 Installation Commands Source: https://docs.eggplantsoftware.com/epf/23.3/epf-installing-eggplant-functional A sequence of commands to install Eggplant Functional on Ubuntu 22.04. This includes extracting the archive, removing previous versions, updating the system, and installing the new package. Replace placeholders with actual filenames and paths. ```bash tar xvfz Eggplant_.tgz sudo apt remove eggplant sudo apt update sudo apt install /Eggplant.deb ``` -------------------------------- ### Send GET Request Example Source: https://docs.eggplantsoftware.com/epf/23.3/epf-api-editor Demonstrates how to construct a GET request to retrieve data from an API. It shows the use of suite variables for the base URL and query parameters for filtering results. The response can be parsed using SenseTalk. ```SenseTalk [[baseURL]]/issues.xml?limit=10 ``` -------------------------------- ### Start RQM Adapter Script for Linux Source: https://docs.eggplantsoftware.com/legacy/eINT/int-installing-rqm-adapter This script is used to start the RQM adapter on a Linux execution machine. It is typically executed after the adapter has been installed and configured. ```bash /opt/TestPlant/start_rqm_adapter.sh ``` -------------------------------- ### Start RQM Adapter Script for Windows Source: https://docs.eggplantsoftware.com/legacy/eINT/int-installing-rqm-adapter This script is used to start the RQM adapter on a Windows execution machine. It is typically executed after the adapter has been installed and configured. ```batch C:\TestPlant\start_rqm_adapter.bat ``` -------------------------------- ### Start RQM Adapter Script for Mac Source: https://docs.eggplantsoftware.com/legacy/eINT/int-installing-rqm-adapter This script is used to start the RQM adapter on a Mac execution machine. It is typically executed after the adapter has been installed and configured. ```bash /Library/TestPlant/start_rqm_adapter.sh ``` -------------------------------- ### GET Request Example Source: https://docs.eggplantsoftware.com/epf/23.4/epf-api-editor Demonstrates how to send a simple GET request to an API to retrieve a list of recent issues. It covers selecting the HTTP verb, entering the API address with optional parameters, and handling authentication. ```APIDOC ## GET /issues.xml?limit=10 ### Description Retrieves a list of the most recent 10 issues from an error tracking system. ### Method GET ### Endpoint [[baseURL]]/issues.xml?limit=10 ### Parameters #### Query Parameters - **limit** (integer) - Optional - Specifies the maximum number of issues to return. Example: `?limit=10` ### Request Example ``` GET [[baseURL]]/issues.xml?limit=10 HTTP/1.1 Host: example.com ``` ### Response #### Success Response (200) - **body** (XML or JSON) - The body of the response sent by the server, containing the issue data. #### Response Example ```xml 1 Bug found in login page 2023-10-27T10:00:00Z ``` ``` -------------------------------- ### Get Current File Position (Example) Source: https://docs.eggplantsoftware.com/epf/23.4/stk-file-folder-interaction This example demonstrates how to use the 'Current Position in File' function to retrieve the current byte position in a file. The function takes the filename as an argument and returns the position, where 1 signifies the start of the file. ```plaintext get the current position in file myFile ``` -------------------------------- ### MoveTo Command Syntax Examples Source: https://docs.eggplantsoftware.com/legacy/ePF/SenseTalk/stk-webdriver-mouse-keyboard-events Provides examples of the MoveTo command syntax using different identifier types and optional parameters like WaitFor. It demonstrates how to specify elements by partial link text, CSS selector, or ID. ```SenseTalk moveTo (webPartialLinkText:"TestPlant") ``` ```SenseTalk MoveTo (WebCSSSelector:"div[class*=icon-savings-small]",WaitFor:10) ``` ```SenseTalk Moveto (WebID:"sign-in-button") // Scrolls the element into the viewport by first locating it in the DOM ``` -------------------------------- ### WebConnect Command Syntax Examples Source: https://docs.eggplantsoftware.com/legacy/ePF/SenseTalk/stk-webdriver-actions Demonstrates the syntax for the WebConnect command, including connecting to a specified host, browser, port, name, and URL. It also shows how to connect to a pre-configured WebDriver connection by name. ```SenseTalk WebConnect host:"192.168.199.132", browser: "chrome", port: "4444", name: "Connection2", url: "http://testplant.com" ``` ```SenseTalk WebConnect "WindowsChrome" // Connects to a pre-configured WebDriver connection named 'WindowsChrome' in the Connection List ``` -------------------------------- ### Get list of installed applications on iOS/Android SUT Source: https://docs.eggplantsoftware.com/epf/23.3/epf-v16-release-notes The new 'appList()' function retrieves a list of all applications installed on an iOS or Android System Under Test (SUT). This is valuable for inventory management or pre-test setup validation. ```SenseTalk put appList() ``` -------------------------------- ### Eggplant DAI Environment Variable Configuration (Shell) Source: https://docs.eggplantsoftware.com/dai/ja/DAI%2025.3/dai-windows-install-silent Example of setting environment variables for Eggplant DAI installation, which is a more secure alternative to storing credentials directly in the silent.ini file. These variables are uppercase equivalents of the INI file settings. ```shell export DAI_ADMIN_USERNAME="your_dai_admin_username" export DAI_ADMIN_PASSWORD="your_dai_admin_password" export KEYCLOAK_ADMIN_USERNAME="your_keycloak_admin_username" export KEYCLOAK_ADMIN_PASSWORD="your_keycloak_admin_password" ``` -------------------------------- ### Verify Docker Installation with 'hello-world' (Shell Command) Source: https://docs.eggplantsoftware.com/gai/GAI%201.1/deploy-with-docker-windows Runs the 'hello-world' Docker image to confirm that Docker is installed and functioning correctly. A successful run will display a confirmation message. ```shell docker run hello-world ``` -------------------------------- ### GET /websites/eggplantsoftware/performance Source: https://docs.eggplantsoftware.com/emi/emi-api-sample-queries Retrieves detailed performance metrics for page monitor tests, including DNS resolution time, connect time, data start time, and overall download time. ```APIDOC ## GET /websites/eggplantsoftware/performance ### Description This endpoint retrieves detailed performance metrics for page monitor tests within a specified time range. It includes DNS resolution time, connection time, data start time, and overall download time for each test result. ### Method GET ### Endpoint `https://api.mon.eggplant.cloud/current/Return/[Account[Pages[Page[Url,Label,TestResults[TestResult[LocalDateTime,DnsSeconds,ConnectSeconds,DataStartSeconds,TotalSeconds]]]]]]/AccountId/{accountId}/Id/{pageMonitorId}/StartDate/{startDate}/StartTime/{startTime}/EndTime/{endTime}` ### Parameters #### Path Parameters - **accountId** (string) - Required - The ID of the account. - **pageMonitorId** (string) - Required - The ID of the page monitor. - **startDate** (string) - Required - The start date for the query (YYYY-MM-DD). - **startTime** (string) - Required - The start time for the query (HH:MM:SS). - **endTime** (string) - Required - The end time for the query (HH:MM:SS). #### Query Parameters None ### Request Example ``` GET https://api.mon.eggplant.cloud/current/Return/[Account[Pages[Page[Url,Label,TestResults[TestResult[LocalDateTime,DnsSeconds,ConnectSeconds,DataStartSeconds,TotalSeconds]]]]]]/AccountId/MN1A8878/Id/MN1PG43413/StartDate/2014-05-25/StartTime/00:00:00/EndTime/11:50:23 ``` ### Response #### Success Response (200) - **Account.Pages.Page.Url** (string) - The URL of the monitored page. - **Account.Pages.Page.Label** (string) - The label of the monitored page. - **Account.Pages.Page.TestResults.TestResult.LocalDateTime** (string) - The date and time of the test result. - **Account.Pages.Page.TestResults.TestResult.DnsSeconds** (string) - DNS resolution time in seconds. - **Account.Pages.Page.TestResults.TestResult.ConnectSeconds** (string) - Connection time in seconds. - **Account.Pages.Page.TestResults.TestResult.DataStartSeconds** (string) - Data start time in seconds. - **Account.Pages.Page.TestResults.TestResult.TotalSeconds** (string) - Overall download time in seconds. #### Response Example ```xml ``` ``` -------------------------------- ### Initialize Device Using Tell Block - SenseTalk Source: https://docs.eggplantsoftware.com/epf/stk-communicating-with-the-device Shows how to initialize a device using the `tell` block and `setValue` command without any additional parameters. This is useful for resetting or preparing the device. ```SenseTalk tell powerAnalyzer to setValue "initialize" ``` -------------------------------- ### SenseTalk - Using 'turn on' and 'turn off' Commands Source: https://docs.eggplantsoftware.com/epf/25.3/epf-v22-release-notes Provides examples of the 'turn on' and 'turn off' commands in SenseTalk, which offer a readable syntax for setting properties or bit values to true/On or false/Off. ```SenseTalk turn on the caseSensitive -- sets the caseSensitive property to true turn the caseSensitive off -- sets the caseSensitive property to false turn on bit 4 of powerFlags ``` -------------------------------- ### Start Model Execution Request Body Example Source: https://docs.eggplantsoftware.com/dai/dai-post-start-execution Example JSON structure for the request body to start a model execution. It includes parameters like model_id, execution_type, and optional agent and asset configurations. ```json { "execution_type": "executing", "model_id": "your_model_id_here", "test_case_id": 123, "agent": { "agent_id": "your_agent_id", "is_hosted_agent": false } } ``` -------------------------------- ### SenseTalk: Sample Click Commands with Tokens Source: https://docs.eggplantsoftware.com/epf/23.3/epf-sensetalk-browser Demonstrates the structure of sample SenseTalk click commands that utilize various token types like text and image for specifying actions. These tokens act as placeholders that need to be replaced with actual values during script editing. ```SenseTalk Click (Text:"[textToFind]") Click ([xCoordinate],[yCoordinate]) Click "[@imageName]" ``` -------------------------------- ### Start Model Execution - Example Request Body Source: https://docs.eggplantsoftware.com/dai/DAI%2025.1/dai-post-start-execution An example JSON object representing a successful response from the Start Execution endpoint. It includes the 'execution_id' which is returned upon successful initiation of a model run. ```JSON { "execution_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6" } ``` -------------------------------- ### Get All Unit Names with unitNames() in SenseTalk Source: https://docs.eggplantsoftware.com/epf/ja/dict_unitNames The `unitNames()` function retrieves a list of all recognized unit names in SenseTalk. This example demonstrates how to filter the results to find unit names starting with 'o'. It is available from SenseTalk version 1.67 onwards. ```SenseTalk put each item of unitNames() which begins with "o" ­­> ["ounces","ohms","ounce","ohm","oil barrels","ozt","oz","olympicswimmingpool","omers","omer","olympicswimmingpools","oilbarrel"] ``` -------------------------------- ### Example GET Request for a Job Template Source: https://docs.eggplantsoftware.com/legacy/EPA/api/epa-api-get-one-template This snippet demonstrates how to make a GET request to retrieve a specific job template using its ID. It includes the necessary API endpoint path and example headers for authentication and realm specification. ```shell curl -X GET \"https://{your_domain}/api/jobTemplates/12345\" \\ -H \"Realm: account_realm\" \\ -H \"Authorization: Bearer YOUR_ACCESS_TOKEN\" ``` -------------------------------- ### Initialize Web Browser and Configure Protocol in Java Source: https://docs.eggplantsoftware.com/legacy/epp/9.4.0/ePP/epp-regions-sample-code This Java code snippet initializes the web browser, sets a default user agent, and configures the protocol for a web request. It demonstrates how to retrieve string and integer parameters for configuration and prepare for subsequent actions. ```java package com.testplant.testing; import java.time.Duration; import java.util.EnumSet; import java.util.List; import java.util.ArrayList; import com.facilita.fc.runtime.*; import com.facilita.fc.runtime.backgroundScripting.*; import com.facilita.util.*; import com.facilita.exception.*; import com.facilita.fc.web.*; import com.facilita.fc.jni.*; public class MyWebSocketScript extends com.testplant.testing.MyCustomJavaScript { IpEndPoint myWebsite = null; // a parameterized web server address Protocol protocol = null; // a parameterized protocol public void pre() throws Exception { super.pre(); getWebBrowser().setDefaultUserAgent(getString("User-Agent","Mozilla/5.0")); } public void script() throws Exception { myWebsite = new IpEndPoint(getString("myHost", "www.mywebsite.com"), getInt("myPort", 80)); protocol = getProtocol("protocol1", "http"); Action1_Start(); } void Action1_Start() throws Exception { startTransaction("Start"); Url url1 = new Url(protocol, myWebsite, "/StockTicker"); try (Request request1 = getWebBrowser().createRequest(HttpMethod.GET, url1, 1)) { request1_ProcessSubRequests(request1); try (Response response1 = request1.send()) { response1.verifyTitle("My website", ActionType.ACT_WARNING); } } Url url2 = new Url(protocol, myWebsite, "/StockTicker/start"); QueryData queryData2 = new QueryData(); queryData2.add("transport", "webSockets"); queryData2.add("connectionData", "[{{\"name\":\"stockticker\"}}]"); url2 = url2.withQuery(queryData2); WebSocket webSocket2 = getWebBrowser().createWebSocket(url2, 2); set("webSocketMessageQueue2", new WebSocketMessageQueue(webSocket2)); webSocket2.registerReceivedMessageCallback((ws, message) -> webSocket2_onReceivedMessage(ws, message)); webSocket2.registerErrorCallback((ws, errorMessage) -> webSocket2_onError(ws, errorMessage)); webSocket2.registerClosedCallback((ws, closedByClient, reason)-> webSocket2_onClosed(ws, closedByClient, reason)); webSocket2.open(); set("webSocket2", webSocket2); ((WebSocket)get("webSocket2")).sendMessage("{\"S\": \"EPP\"}"); } // Placeholder for other methods like request1_ProcessSubRequests, webSocket2_onReceivedMessage, etc. void request1_ProcessSubRequests(Request request) throws Exception {} void webSocket2_onReceivedMessage(WebSocket ws, String message) {} void webSocket2_onError(WebSocket ws, String errorMessage) {} void webSocket2_onClosed(WebSocket ws, boolean closedByClient, String reason) {} } ``` -------------------------------- ### setValue Command Examples Source: https://docs.eggplantsoftware.com/epf/23.3/stk-communicating-with-the-device These examples demonstrate the usage of the 'setValue' command with different argument formats, including special phrases and separate parameters. They show how to set output states and voltages, with corresponding SCPI command generation. ```SenseTalk setValue "output state for M1.DataOut1 to On" setValue "voltage on channel 2", 170 millivolts setValue "calibrate state to on", password ``` -------------------------------- ### Start Run Agent Service Source: https://docs.eggplantsoftware.com/dai/DAI%207.4/dai-run-agent-as-windows-service Command to start a previously installed Run Agent Windows service. The service name must be specified if multiple Run Agent services are installed. ```powershell eggplantDAIRunAgent.exe --win-service start --service-name "DAI Agent Service 1" ``` -------------------------------- ### query Command Example Source: https://docs.eggplantsoftware.com/epf/23.3/stk-communicating-with-the-device This example demonstrates the usage of the 'query' command with a special phrase to measure voltage on a specific channel. It shows the generated SCPI command for the query. ```SenseTalk query "Measure Voltage on channel 2" ``` -------------------------------- ### Start Execution Request Body Example (JSON) Source: https://docs.eggplantsoftware.com/dai/ja/DAI%206.5/dai-post-start-execution This example demonstrates a JSON request body for starting a model execution. It includes parameters like `model_id` and `execution_type`. For more complex configurations, additional parameters such as `agent`, `test_case_id`, or `script` can be included to control the execution environment and logic. ```JSON { "model_id": "your_model_id_here", "execution_type": "executing" } ``` -------------------------------- ### Example RHEL 8 Installation Sequence Source: https://docs.eggplantsoftware.com/epf/23.4/epf-installing-eggplant-functional A sequence of commands for installing Eggplant Functional on RHEL 8. Includes extracting the archive, removing any existing installation, and installing the new package. Ensure paths and versions are updated. ```bash tar xvfz Eggplant_EnterpriseLinux8_.tgz sudo dnf remove Eggplant sudo dnf install /Eggplant_EnterpriseLinux8/Eggplant_EnterpriseLinux8_.rpm ``` -------------------------------- ### Open Socket with Host and Port Source: https://docs.eggplantsoftware.com/legacy/ePF/SenseTalk/stk-socket-process-input-output This example shows how to open a socket connection using an IP address and port number. The 'socketIdentifier' must be in the 'host:port' format, where 'host' is the IP address and 'port' is the port number of the target process. ```SenseTalk open socket "192.168.1.4:22" ``` -------------------------------- ### Start Run Agent Service (Default) Source: https://docs.eggplantsoftware.com/dai/DAI%2025.1/dai-run-agent-as-windows-service Starts the default Run Agent Windows service. If multiple services are installed, the default service (usually 'DAI Run Agent') is started. ```bash "C:\Program Files (x86)\eggplantDAIRunAgent\eggplantDAIRunAgent.exe" --win-service start ```