Basic knowledge of Java programming language and Eclipse is required.
It is assumed that you are using the default installation of MyITest4U.
MyITest4U comes with an Eclipse project. This can be used to fine tune MyITest4U. The Eclipse project has to be imported into Eclipse before it can be used. The workspace should be: C:\AutoTest\MyITest4U\TestEngine\Java. The project is in the folder C:\AutoTest\MyITest4U\TestEngine\Java\Api.
Logging
The following method can be used for logging:
Creating Your Own Actions
MyITest4U allows you to create your own actions.
Create your own action by copying and changing the TemplateAction (com.myitest4u.selenium.api.actions).
Enter your action code in the method doAction.
Enter a rule in the method addAction. The rule determines for which GUI elements your custom action is shown in the editor. Return true to always show your custom action.
The method showException determines if the stack trace is shown in case of an error or not. A return value of true will show the stack trace. A return value of false will hide the stack trace.
Open the class MyActionList.
Add your action to the action list.
Compile the project.
Your custom action is now ready to use.
Handling Of Language Dependent Strings
The class MyLanguageHandler can be used to handle language dependent strings. Therefore you need to implement the method setToBeHandled(String toBeHandled). A very basic example of an implementation of setToBeHandled is:
The language change will happen at the following places:
The checkpoints Find and NotToFind in the parameter files.
The Global Find and Global NotToFind.
The text if a GUI element is found using ByLinkText or ByXPathText.
All actions using a language dependent text e.g. CheckAttribute.
Web Drivers
Selenium Web Driver allows you to set specific options for your Web Driver.
MyITest4U allows you to set the web driver options using the class WebDriverOptions.
The driver options can be set by implementing a method which sets the driver options e.g. Object getChromeOptions().
The method used to set the web driver options has to return an Object. The Object has to be the class implementing the Selenium Web Driver options e.g. ChromeOptions (Instantiation of the Selenium Web Driver is done by reflection).
This method is used in the method getDriverOpitons(String driverName, String option).
The method getDriverOpitons(String driverName, String option) is called when the Web Driver is instantiated. The returned DriverOptionsContainer object contains the two fields String optionsClassName and Object options. They need to be set accordingly.
An example of the class WebDriverOptions is given below.