Skip to content

**General Class **

The purpose of this document is introducing classes, objects that user use in the CustomKeyword.

In addition to built-in keywords, you can define custom keywords to extend the capabilities of akaAT Studio. Once created, custom keywords can be used when implementing test cases, just like other built-in keywords.

4.1.1. Init WebElement using CustomKeyword

1.   public void getWebElementDemo(UIObject target) {
2.           //Get WebDriver
3.           RemoteWebDriver webDriver = WebDriverUtilities.getDriver();
4.           //get the 1st WebElement form UIObject. If UIObject NOT found, throw exception and  fail step
5.           WebElement element = target.convertToWebElement(webDriver); 
6.           //get the 1st WebElement from UIObject, if UIObject NOT found, return element = null
7.           WebElement element2 = target.convertToWebElementQuietly(webDriver);
8.           /*get the 1st WebElement from UIObject, execute continious in timeout = 5s and return as soon as possible
9.           If element NOT found, throw exception and fail step*/
10.         WebElement element3 = target.convertToWebElementWithTimeout(webDriver, 5);
11.         /*get the 1st WebElement from UIObject, execute continious in timeout = 5s and return as soon as possible
12.         If element NOT found, return element = null*/
13.         WebElement element4 = target.convertToWebElementWithTimeoutQuietly(webDriver, 5);
14.         /*get list WebElement from UIObject
15.         If UIObject not found, return null*/
16.         List<WebElement> element5 = target.convertToWebElementList(webDriver);
17.         /*get list WebElement from UIObject, execute continious in timeout = 5s and return as soon as possible
18.         If UIObject NOT found, return “ ”
19.         List<WebElement> element6 = target.convertToWebElementListWithTimeout(webDriver, 5); 
20.     }

4.1.2. Assertion in CustomKeyword

In the CustomKeyword java file, AkaAT Studio tool support KeywordAssertion class.

For example:

4.1.3. ElementActionKeyword

AkaAT Studio tool support multiple methods in ElementActionKeyword class to interact with an UI element for three platforms: Web, Mobile application, Desktop, App.

4.1.4. VerifyElementKeyword

4.1.5. WaitForKeyword

4.1.6. Import image to the testing report

AkaAT Studio tool support ReportUtilities class. User can import any image to testing report instead of the default photo of the report.

1.   ReportUtilities.saveImageForReport(File imageFile) // Copy file to the report
2.   ReportUtilities.saveImageForReport(byte[] imageBytes) // Write image file to the report folder based on the image bytes provided by the user