| || |
I want to copy and paste code from one script to another. Can anyone tell me how to copy over the corresponding object map? Well, in most cases I wouldn't need or want the whole map.
Unfortunately, there is no way of copy/pasting an Object map with RobotJ.
The closest thing to that is making a global object map and use that object map (instead of private object map) for creating your scripts.
I hope this helps
RobotJ's main objective is to use the Test Object Map for various scripts. We can use the Test Object Map of one script to another by creating a Test Object Map in the DataStore.
Follow the below steps...
1. File-->New-->Test Object Map
2. Name the Object Map and select the Datastore where you want to put it.
3. Click Next. In that Select the checkbox "Select a Test Object Map or a RobotJ Script to copy Test Objects from"
4. Select the script which has your required Test Object Map.
5. Then select Finish. Then you may find the New Test Object Map in the listing.
Now we have made this Map as a Public one. While creating the scripts, you can use this object map. In the Explorer Window(OM and VP) of the Particular Script, you find this OM. Then you have to manually insert the Objects into the script. Otherwise they are not inserted to your script.