In Silk4J, image assets, image verifications, and object maps are referred to as assets. If you want to use assets outside of the scope of the project in which they are located, you need to add a direct project dependency from the project in which you want to use the assets to the project in which the assets are located. When you are playing back tests from Eclipse, all dependent projects are added to the classpath for the test execution, and therefore Silk4J can find the assets in the dependent projects.
During replay, when an asset is used, Silk4J firstly searches in the current project for the asset. The current project is the JAR file which contains the test code that is currently executed. If Silk4J does not find the asset in the current project, Silk4J additionally searchesall other projects in the classpath.. If the asset is still not found, Silk4J throws an error.
If assets with the same name exist in more than one project, and you do not want to use the asset that is included in the current project, you can define which specific asset you want to use in any method that uses the asset. To define which asset you want to use, add the asset namespace as a prefix to the asset name when calling the method. The asset namespace defaults to the project name.
window.imageClick("imageAsset");and the image asset imageAsset is located in project ProjectB, you need to add a direct project dependency from ProjectA to ProjectB.
To add a project dependency in Eclipse, right-click the project and select Properties. Select Java Build Path, click on the Projects tab, and add your project here.