Ask a Question

Can not click on 'caret' - invisible to TestComplete!

SOLVED
royd
Regular Contributor

Can not click on 'caret' - invisible to TestComplete!

In main menu, we have some nested sub-menu, that can be revealed by clicking on caret to expand sub-menu.  The caret is invisible to Object Spy! Tried to record script and keyword test. Both failed!

 

This is probably a good time to mention I am new to JScript/JavaScript! Example will be much appreciated. I am using  TestComplete 12 with Jascript (not converted the scripts to JavaScript yet, due to tight deadline) and IE11. Please see the screens below.

 

 

TC-caret.pngexpanded.pngcaret class-name.pngO_browser.png

Thanks in advance.

 

Dave

 

20 REPLIES 20
tristaanogre
Esteemed Contributor

First of all... super Kudos to how you presented the problem.  We have screenshots of the UI presentation, we have a shot showing us how the item shows up on the web page source, and we have how TestComplete views the item in the object browser.  Without having your application in front of us, this is EXCELLENT information to help us figure things out.

That said, looking at the way the menu is presented, and unless there is other information, what you'll probably end up doing is clicking on the Link('FODMenu_Emergency') object in your script code, doing a "page.Wait()", and then clicking on the next link.  The reason I say this is that the caret is not actually being rendered, as I can see, as some sort of control but as simply a visual component of the href link itself.  This is why TC is not recognizing it as an object... it's actually part of the Link object.


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
sanjay0288
Frequent Contributor

Hi,

  Can you please attach a screenshot of the available properties and methods of the Caret object in advanced view mode. Meanwhile you can try with the below mentioned code.

 

(AUT emergency context menu object)Link("FOD_MenuEmergency).set_IsSubmenuOpen(True)

 

Regards,

Sanjay

royd
Regular Contributor

Hi Robert. Thanks for the compliment! I figured, if I am asking for help, better be through. 🙂

 

The rub is, when clicked on the menu itself, it populates all forms under the category, but does not expand the sub-category! 

 

sub.png

 

 

@ Sanjay

 

Thanks for your suggestion, I will try and post the result here. The first screenshot is actual shot of Object spy highlighting the menu itself, unaware of the caret. Here is the screen you asked for. I might add, under 'Internet Explorer' (Object Spy > Properties), the innerHTML = <b class="caret" name="caret_Emergency"></b>
Emergency

 

and

 

outerHTML = <a name="FODMenu_Emergency" class="selected" href="#" data-category="Level/2">
<b class="caret" name="caret_Emergency"></b>
Emergency
</a>

 

I don't know if that helps in anyway.

 

 

prop.png

 

Thanks.

 

Dave

 

 

 

 

 

tristaanogre
Esteemed Contributor

Gotcha.  OK... so,, the next thing we need is to see if there are any methods or such to "expand".  The reason being is that, as noted, the "caret" is being seen as just a class on the link.  Are there other methods associated with the link about clicking on the caret?  Check the NativeWebObject property and see what methods show there, if there are different "click" methods.  


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
royd
Regular Contributor

Okay, for NativeWebObject we have:

 

  • click
  • querySelector
  • querySelectorAll

 

Thanks

royd
Regular Contributor

Hi Sanajy

 

When I run (did not bother to map for testing) -

 

Sys.Browser("iexplore").Page("https://url/.../FOD/SelectForms.aspx*").Form("aspnetForm").Table(0).Cell(0, 0).Panel(0).Panel("NavFormsOnDemand").Panel("navMenuInner").Link("FODMenu_Emergency").set_IsSubmenuOpen(True);

 

I get an error: 'True' is undefined. Probably making some mistale. FYI, also tried Click() method as well, same error.

tristaanogre
Esteemed Contributor

What about methods on the main link object itself?  Also, are there any "onclick" properties set on the link?


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
tristaanogre
Esteemed Contributor


@royd wrote:

Hi Sanajy

 

When I run (did not bother to map for testing) -

 

Sys.Browser("iexplore").Page("https://url/.../FOD/SelectForms.aspx*").Form("aspnetForm").Table(0).Cell(0, 0).Panel(0).Panel("NavFormsOnDemand").Panel("navMenuInner").Link("FODMenu_Emergency").set_IsSubmenuOpen(True);

 

I get an error: 'True' is undefined. Probably making some mistale. FYI, also tried Click() method as well, same error.


If you're using JScript, it's case senstive... change "True" to "true"


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
royd
Regular Contributor

Hi Robert, "true" gave an error "Unable to find the object set_IsSubmenuOpen(true). See Additional Information for details. 14:38:30 Normal"

 

Methods for "onclick" is (Null), has no methods t it. The object "Emergency" has the following:

 

onclick1.png

 

and

 

onclick2.png

 

Thanks.

 

Dave

cancel
Showing results for 
Search instead for 
Did you mean: