Forum Discussion

Oferv's avatar
Oferv
Super Contributor
14 years ago

Why I'm unable to click a control?

Hi,



i have this control:



Aliases["FusionDesktop"]["HwndSource_MainWindow"]["MainWindow"]["Grid"]["TabControl"]["Grid"]["ContentPanel"]["PART_SelectedContentHost"]["AssemblyViewTabControl"]["Grid"]["Grid1"]["UserControl"]["ScrollableTabControlScreen"]["DockPanel"]["ContentControl"]["DocumentViewer"]["m_thumbnails"]["ListBoxItem"]



but when trying to click it using:



Aliases["FusionDesktop"]["HwndSource_MainWindow"]["MainWindow"]["Grid"]["TabControl"]["Grid"]["ContentPanel"]["PART_SelectedContentHost"]["AssemblyViewTabControl"]["Grid"]["Grid1"]["UserControl"]["ScrollableTabControlScreen"]["DockPanel"]["ContentControl"]["DocumentViewer"]["m_thumbnails"]["ListBoxItem","",1]["Click"]



the script says,during playback,that it's waiting for 1(the 1 i bold above).

if you'll take a look at the screenshot you'll see that Click() is along the object's method i can use since it's on the list but,somehow TC is unable to click it.

more then that,when standing on the object browser on the ["ListBoxItem"] object you'll see that it show as ["ListBoxItem","",INDEX] but,when typing this text in the script it doesn't recognize that.

pls see attached file.

why is that??and how can i click this object by its index?



Thanks

2 Replies

  • Oferv's avatar
    Oferv
    Super Contributor
    Tc Says "waiting untill ovelapped window becomes visible" why is this message display although there's no overlapping window?



    thx
  • Hi,


    You are confusing addressing the object by the alias and by the full name.


    You cannot use ...["DocumentViewer"]["m_thumbnails"]["ListBoxItem","",1]["Click"], because ["ListBoxItem"] is the alias that is used to address your object in the test, and you cannot specify the index for the alias. You can specify the index if you address the object by the full name: ...["WPFObject"]("DocumentViewer")["WPFObject"]("m_thumbnails")["WPFObject"]("ListBoxItem","",1) (you can see the full name in the Object Browser panel).


    So, to click the needed list box item, use the following statement:




    Aliases["FusionDesktop"]["HwndSource_MainWindow"]["MainWindow"]["Grid"]["TabControl"]["Grid"]["ContentPanel"]["PART_SelectedContentHost"]["AssemblyViewTabControl"]["Grid"]["Grid1"]["UserControl"]["ScrollableTabControlScreen"]["DockPanel"]["ContentControl"]["DocumentViewer"]["m_thumbnails"]["ListBoxItem"]["Click"]


    In order for TestComplete to click the item that has the index 1, you need to add the Index property to the set of identification properties of the mapped object that has the ListBoxItem alias. For more information, please refer to http://support.smartbear.com/viewarticle/11327/ and http://support.smartbear.com/viewarticle/12451/.


    As for the message about an overlapped window, could you please clarify when this message appears?