Ask a Question

mapping elements automatically by script?

jsc
Regular Contributor

mapping elements automatically by script?

Hello all,

 

I have to start automating another plugin of our software.

 

I normally start by building the namemapping from scratch by mapping all needed elements manually.

This is quite boring and time consuming, but a really solid namemapping is the fundament for our quite robust tests.

 

So I thought about doing a greater part of this automatically.

Is it possible to add all visible elements (in a webpage) automatically to an existing (or empty) namemapping by script?

 

Afterwards I will have to go through the elements and remove the unneeded ones or check the criteria for recognition.

 

Any help is welcome!

Best regards,

Joachim

 

 

7 REPLIES 7
jsc
Regular Contributor

Re: mapping elements automatically by script?

Is there no useful possibility to map all elements automatically and check them afterwards manually?

I think this would be fast as manually mapping all the elements.

william_roe
Super Contributor

Re: mapping elements automatically by script?


@jsc wrote:

Is there no useful possibility to map all elements automatically and check them afterwards manually?

I think this would be fast as manually mapping all the elements.


You might be able to get 80% there with automatic mapping. For our SPA (single page application) applacation the Frames are the key element to map ahead of time and put wildcards in the appropriate place(s). 

 

I will NEVER AGAIN use extended find. I can't tell you how much time this "feature" has cost. YMMV

 

Manual mapping isn't all that tedious but we may give auto mapping another go of it now that we understand it better.

jsc
Regular Contributor

Re: mapping elements automatically by script?


@william_roe wrote:

You might be able to get 80% there with automatic mapping. For our SPA (single page application) applacation the Frames are the key element to map ahead of time and put wildcards in the appropriate place(s). I would be willing to go fully automatic if renaming worked better. I've found when renaming mapped objects that property checkpoints don't get updated. 

 

I will NEVER AGAIN use extended find. I can't tell you how much time this "feature" has cost. YMMV


I am not sure, if I understand you correctly.

 

1. Did you map the elements via script? e.g. opening the page whose elements should be mapped and then started some script, that mapped all the elements to the namemapping file?

 

2. what problems with extended find did you have? We could not live without it... The namemapping must be horrible without it! It is sometimes slow but the test is really readable.

william_roe
Super Contributor

Re: mapping elements automatically by script?


@jsc wrote:

@william_roe wrote:

You might be able to get 80% there with automatic mapping. For our SPA (single page application) applacation the Frames are the key element to map ahead of time and put wildcards in the appropriate place(s). I would be willing to go fully automatic if renaming worked better. I've found when renaming mapped objects that property checkpoints don't get updated. 

 

I will NEVER AGAIN use extended find. I can't tell you how much time this "feature" has cost. YMMV


I am not sure, if I understand you correctly.

 

1. Did you map the elements via script? e.g. opening the page whose elements should be mapped and then started some script, that mapped all the elements to the namemapping file?

 

2. what problems with extended find did you have? We could not live without it... The namemapping must be horrible without it! It is sometimes slow but the test is really readable.


 

1. We currently map the field(s) we are going to use in the keyword test via the object browser

2. Extended find caused us memory issues. The Chrome hook would grow to nearly 2gig and stop responding.

 

We prefer reliable testing over ease of test creation.Playback speed also seems better without extended find.

jsc
Regular Contributor

Re: mapping elements automatically by script?

Hi william,

 

we have memory issues too, but not (afais) with the chrome hook, but with TestComplete itself (taking 1.2+ GB RAM). I opened a support case and now got a response... hopefully it is fixed.

Our test with extended find runs perfectly fine. Maybe your application / namemapping tree is much larger than ours.

 

So I cannot be lazy and let a script do the mapping... I will have to do it myself. grml

 

Best regards,

Joachim

Colin_McCrae
Community Hero

Re: mapping elements automatically by script?

You can right click on an object you already have in your map and there is a "map all child objects" option for it.

 

So you can go object by object, layer by layer.

 

No exactly what you want, but maybe better than one by one. I'm not convinced though. I use your current method of doing it manually. I do the high level, core items, initially, then add detail as tests are built. I also use helper functions so find smaller, lower level, objects on the fly during run time. And a well thought out Alias map.

 

I also don't like extended find as it can hide problems.

 

And I've never liked "add everything" type mapping options. QTPro let you do that. We spent more time tidying up the huge horrible mess it created than we saved by grabbing everything at once in the first place .....

jsc
Regular Contributor

Re: mapping elements automatically by script?

ok, I stick with my current method.

cancel
Showing results for 
Search instead for 
Did you mean: