[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [qftestJUI] Can qftestJUI be used under this situation?
Hi Kevin, such things cannot be captured directly because qftestJUI doesn't have any idea what's shown in the canvas, but you can easily use Jython to achieve what you want. Let's say your canvas has a method called getLocation(String objectID) that retrieves the position of some graphic item. You can the create a procedure in qftestJUI that simulates a click on such an item as follows: First record a single mouse click on the canvas so the canvas component gets recorded. Let's assume the component id is "Canvas". Change the X/Y coordinates of the MPRC node to $(ix), $(iy) and move the node inside a newly created procedure as shown below. + Procedure clickItem (Parameters objectID, x, y where x and y will be relative to item, 1,1 are good defaults for x,y) + SUT script [see below] + MPRC ($(ix), $(iy)) on Canvas The SUT script needs to offset the given x/y coordinate to the position of the item: # get hold of the actual canvas object canvas = rc.getComponent("Canvas") # determine item location pos = canvas.getLocation(rc.lookup("objectID")) # store target position in ix/iy rc.setLocal("ix", $(x) + pos.x) rc.setLocal("iy", $(y) + pos.y) That's all there is to it. That generic procedure can be used whenever you need to click on an item in your canvas. For details about the script, see the API reference and the scripting chapter in the user manual. Best regards, Greg Kevin Duffey <supreme_java_guru_1@?.com> writes: > Hi everyone, > > We are looking to see if there is any way we can run > custom java code to access our internal APIs of our > application as part of the record/playback process. > The problem is, 2/3 of our application is a huge > canvas that we paint on with our own simulated painted > components. Is there any way to record/playback this > without resorting to relative x,y locations? We don't > want things like the size of the painted components, > the size of the window, colors (if image comparisons > are being done) and so forth to be a problem. > > The only way we can see this being useful is if we can > use parts of our internal model that the canvas uses > to render itself with, so that we can get the objects > we are painting, figure out where they are painted, > etc. > > Thanks. -- Gregor Schmid Gregor.Schmid@?.de Quality First Software GmbH http://www.qfs.de Tulpenstr. 41 Tel: +49 8171 919870 DE-82538 Geretsried Fax: +49 8171 919876