Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Create a Java project in Eclipse.
  2. Add the references of Selenium Core Engine in the project. The reference is present at the location QualitiaInstallationFolder\Qualitia<<version>>Qualitia Installation location: %localappdata%\QualitiaWDClient\app-5.0.0\WebDriver.
  3. To set the reference, right-click Project.
  4. On Properties select Java Build Path.
  5. Select Libraries and click Add External Class Folder.
  6. Add the references of Selenium Java Client Jar from the location Selenium-Server-Standalone-x.xx.x.jar
    You can refer to the Key SServerPath set in Qualitia.exe.config.
  7. Add the references of junit.jar from the location QualitiaInstallationFolder\Qualitia<<version>>%localappdata%\QualitiaWDClient\app-5.0.0\WebDriver\lib\junit-x.x.x.jar.
  8. Add the reference for log4j-x.x.xx.jar from the location QualitiaInstallationFolder\Qualitia <<version>>%localappdata%\QualitiaWDClient\app-5.0.0\WebDriver\lib\log4j-x.x.xx.jar
  9. Add the reference mysql-connector-java-x.x.x-bin.jar from the location QualitiaInstallationFolder\Qualitia <<version>>%localappdata%\QualitiaWDClient\app-5.0.0\WebDriver\lib\mysql-connector-java-x.x.x-bin.jar.
  10. Create Java packages and classes in Eclipse.

For example, the class CustomWebEdit is created in the package Custom.CustomObjects.

If the actions are being executed directly on an object, for example, Click, Select, SetValue, SetFocus, then the first parameter of the action needs to be of the class ObjectInfo.
Once the references of Selenium Core Engine are added, the required libraries can be imported into the Custom class.
For example, the Object Info class is imported in the CustomWebEdit class. The Class extends from the existing WebEdit action class.

  • The Custom Actions must extend from an existing class only if a customized action is required to be performed on the existing object.
  • If a new object is created which is not present in Qualitia, for example, WebLabel, then its class must extend from WebObject.

 

  Develop Actions as follows:

...

When an action is to be performed on an object, the object existence can be checked using exist () function. This function can be used by extending WebObject class in the package com\webdriverfw\Wrappers or an existing relevant action class in the package com\webdriverfw\Wrappers.
The Custom action class must extend from an existing action Object class only if some new customized action is required to be performed on the existing object. 
Image Removed Image Added

Once the actions are completed and compiled successfully, you can create a jar file of the Eclipse project or use the files as it is.

Set the path of the compiled class files/jar files in the Qualitia config UI in the key CustomAction Repository Path. Multiple paths can be set using semi colon ( : ;) as the path separator. If a jar file is being used then the path needs to be specified with the complete path including the name of the jar file. If only class files are being used then the path till the base folder of the class needs to be specified. If the classes or projects are referencing any third party jar files, the complete path of the jar files needs to be specified as well. Make sure that the path ends with a semi colon ( : ;).