Monday, July 25, 2016
For this test we'll use the SVG Dragging Sample provided by Peter Collingridge. This application contains a simple SVG canvas that contains two rectangles: one blue, one green that can be dragged around the drawing area:
The objective of our test will be to drag one of the rectangles around the area using Rapise. Since the SVG canvas is visible to Rapise as a single object we'll need to use a combination of HTML library commands and Simulated Object mouse operations.
The first step is to Learn the SVG canvas object. Unlike HTML objects, Rapise sees the entire SVG canvas as a single object, so the easiest thing is to open up the Web Spy (by clicking on Spy > Web Object) and view the DOM tree of the webpage:
Navigate to the <object type="image/svg+xml" /> object that matches the canvas you are interested in (you can use the right-click and Highlight option to ensure you have the correct canvas). Then double-click on the <object> tag to add it to the Learn menu of the Web Spy. Click the Learn button next to the XPATH that was recorded:
and then click Finish to end the Spy session. You now have a learned object that refers to the entire SVG canvas.
If you look in the Object Tree inside Rapise you will see your new Learned object together with its XPATH:
You can now use the SeSSimulated library to record mouse operations relative to that canvas. In the example above we are doing the following:
When you then run this test:
results match your keyword(s)