Ask a Question

Can anyone give a guide on on to code(in Jscript) the selection of items in an Accordion?

presideji_1
New Contributor

Can anyone give a guide on on to code(in Jscript) the selection of items in an Accordion?

Can anyone give a guide on how to code(in J script) the selection of items in an Accordion?

6 REPLIES 6
tristaanogre
Community Hero

Re: Can anyone give a guide on on to code(in Jscript) the selection of items in an Accordion?

Screenshot of the object does not give us enough information to go on in order to give you the help we need.  We need to see the component itself as shown in the Object Browser of TestComplete with the full list of available properties and methods.

 

Alternatively.... what happens when you record on the object?  A good way of figuring out how TestComplete will interact with your object is to do a quick record against it to see what happens.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
presideji_1
New Contributor

Re: Can anyone give a guide on on to code(in Jscript) the selection of items in an Accordion?

Hello,

 

Thanks for your reply. Please, see the new attachment.  I hope it give additional information

presideji_1
New Contributor

Re: Can anyone give a guide on on to code(in Jscript) the selection of items in an Accordion?

Hello,

 

Thanks for your reply. Please, see the new attachment.  I hope it give additional information

tristaanogre
Community Hero

Re: Can anyone give a guide on on to code(in Jscript) the selection of items in an Accordion?

OK, as for the Accordian component, I'm not sure what native support TestComplete can offer to work with it other than the basics of Click and Keys.  I'd have to examine the properties a bit more closely.  What do you need to do with it?

 

As for the rest of your document... that's object recognition errors.  The "Object does not exist" type errors you report are a problem with the accordion object itself but, as the errors indicate, one of the parent objects in the hierarchy is not being identified properly.

 

Aliases.browser.pageConstructionline.panelAppInitPageLoaded.panel.panel.section

 

You need to take a look at the mapping of that object, the properties being used, and adjust those properties so as to make a reliable identification.  As is mentioned frequently here on this community, while the automatic mapping of objects by TestComplete is a good starting point, almost ALWAYS you should go back and rework the mapping to be more reliable.  My guess is that the "section" object indicated is using some sort of property that changes dynamically from test run to test run and so cannot be identified.  Alternatively, there may be more than one "section" in the hierarchy that matches the properties so TestComplete gets the first one it finds which might not be the proper one.  You should go through the entire hierarchy of your object tree and validate the properties being used to map the component so as to give a good, reliable mapping.  Please read through https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/over... for everything there is to know about NameMapping.

 

Side note...

 

While the NameMapping of the item can remain

 

NameMapping.Sys.browser.pageConstructionline.panelAppInitPageLoaded.panel.panel.section.panelContainer.panelRow.formFormNgPristineNgValidNgValid.panelAccordiongroup9428Tab.panelAccordionHd

 

You really should edit your Alias.  The only true parts of the Alias that are meaningful are as follows, just as a best guess

 

Aliases.browser.pageConstructionline.panelAccordionHd

 

This will make your application test much more manageable.

 

 


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
presideji_1
New Contributor

Re: Can anyone give a guide on on to code(in Jscript) the selection of items in an Accordion?

Hello,

Thanks for your replay. I am gradually getting there.

"My guess is that the "section" object indicated is using some sort of property that changes dynamically from test run to test run and so cannot be identified.  " - You are right with this. It changes dynamically from test run to test run.

When I drill down manually to the object behind the field I want to select it is never stable it keeps changing. If I select the object before this it points to a different field

 

What i want to do with it is that;

I want to be able to click on the drop down button on each row and type into the text-box displayed or select options display in the in drop down or click on a radio button or attach a document. Please see attached.

tristaanogre
Community Hero

Re: Can anyone give a guide on on to code(in Jscript) the selection of items in an Accordion?

You need to fix the mapping of the section object.  If the property being used is changing dynamically, then you need to find another property or set or properties that will more accurately identify the object.  Until that is corrected, nothing else you attempt to work with on that Accordion object will work properly.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
cancel
Showing results for 
Search instead for 
Did you mean: