Forum Discussion

Oferv's avatar
Oferv
Super Contributor
14 years ago

How to hold CTRL down???

Hi,



I'm trying unsuccessfully  to select few pages in a document by holding CTRL keyboard key down.

i've tried the following:



Aliases["FusionDesktop"]["HwndSource_MainWindow"]["MainWindow"]["Grid"]["TabControl"]["Grid"]["ContentPanel"]["PART_SelectedContentHost"]["AssemblyViewTabControl"]["Grid"]["Grid2"]["UserControl"]["ScrollableTabControlScreen"]["DockPanel"]["ContentControl"]["DocumentViewer"]["m_thumbnails"]("ListBoxItem")["Keys"]("^[Hold]");



and



Aliases["FusionDesktop"]["HwndSource_MainWindow"]["MainWindow"]["Grid"]["TabControl"]["Grid"]["ContentPanel"]["PART_SelectedContentHost"]["AssemblyViewTabControl"]["Grid"]["Grid2"]["UserControl"]["ScrollableTabControlScreen"]["DockPanel"]["ContentControl"]["DocumentViewer"]["m_thumbnails"]("ListBoxItem")["Keys"]("[Hold]^");



the only thing that is working is:



Sys["Desktop"]["KeyDown"](Win32API.VK_CONTROL)



but,the last one is a bit problem because if i'm debugging i can't do anything untill i'm using 

Sys["Desktop"]["KeyUp"](Win32API.VK_CONTROL)



how to do that?



thankx

18 Replies

  • irina_lukina's avatar
    irina_lukina
    Super Contributor

    Hi Ofer,


    what i'm currently using just moves faster, it ScrollIntoView faster .can you please explain me why?


    It's difficult to say for sure. Could you please post here the value of the ClassName property of the mentioned list box control?


    ho and i also couldn't find wItem under listBox object tree as well. why is that?


    The wItem property is added by TestComplete, and it's specific to the list box controls. That's why, it resides in the Extended properties category. Did you look through this category?


    it looks like item in the marked line is empty. why is that?


    I'm afraid, I cannot answer this question without knowing what exactly has changed in your application since the last test run. Have you changed anything?


    Thanks.

  • Oferv's avatar
    Oferv
    Super Contributor
    ClassNameProperty: System.Windows.Controls.ListBox

    I do find wItem under Extended but it has no value,just the button params next to it(which i don't know what its purpose)

    With regarding the fact that it ran properly ans suddenly it's not i also don't know what has been changed,grrrrrrr....... anything.can you use the AUT i shared with you on the ftp to go over and see what can be the problem?



    Thanks Irirna
  • Oferv's avatar
    Oferv
    Super Contributor
    I've attached a file that shows that listBox.wItem(SelectedPage) exist but TC says it doesn't.

    pls see attached file



    Thanks,
  • Oferv's avatar
    Oferv
    Super Contributor
    Sorry wrong attachment.this is the right one
  • irina_lukina's avatar
    irina_lukina
    Super Contributor

    Hi Ofer,


    I do find wItem under Extended but it has no value,just the button params next to it(which i don't know what its purpose)


    The Parameters button lets you specify the parameters for the selected property of the method. The wItem property has only one parameter - index of the needed list box item. So, to obtain the value of the needed item, you need to click the Parameters button on the right of the wItem property and specify the item's index (zero-based) in the ensuing dialog. When you close this dialog, the wItem line will hold the value of the specified item.


    With regarding the fact that it ran properly ans suddenly it's not


    Most likely, the index is out of bounds. I've looked through the screenshot you posted here and noticed that you are randomly generating the index of the needed item. Why do you do this? Also, you start the index from 1, but it starts from 0 (when you specify it for the wItem property).


    Also, please clarify what you mean when you say that the property doesn't work. Do you see any error message? If you do, please post here the entire text of the shown error.


    Thanks.

  • Oferv's avatar
    Oferv
    Super Contributor
    Hi,



    I select a random item because the purpose of this test is to click a random item,select it and delete it and i'm using the ScrollIntoView in order to "expose" the item to TC(the AUT build by design to high performance so it expose to the user only the number of page can be view on the screen).so,in order for TC to "see" those items i need to scroll it into view.the random pages i'm using is to select a random page which sometime can be one out of 6000.



    When i'm saying it doesn't work i mean that i can see what random page Tc has been selected but when trying to scroll this item into view nothing happen.





    var item = listBox.wItem(SelectedPage) - i can see the selected random number under the watch List

    listBox["ScrollIntoView"](item) - but there's no ScrollIntoView perform



    there are no error messages display i just can't see the selected item scrolled into view



    Thx
  • Oferv's avatar
    Oferv
    Super Contributor
    Lets assume that these are the only line codes i have




    var listBox = Aliases["FusionDesktop"]["HwndSource_MainWindow"]["MainWindow"]["Grid"]["TabControl"]["Grid"]["ContentPanel"]["PART_SelectedContentHost"]["AssemblyViewTabControl"]["Grid"]["Grid2"]["UserControl"]["ScrollableTabControlScreen"]["DockPanel"]["ContentControl"]["DocumentViewer"]["m_thumbnails"] 

    var item = listBox["Items"]["Item"](SelectedPage);                                  

    listBox["ScrollIntoView"](item) 



    if i have 10 items in the list box and SelectedPage=1 the selected item will be truly 1 but,if SelectedPage=10 the script throw an error,see attached file.
    so i can't understand how do i select the last item?????!!!!!!



    can you please explain why is that happen?



    thanks
  • irina_lukina's avatar
    irina_lukina
    Super Contributor

    Hi Ofer,


    I've found your support case in our DB. Please, continue working with David via e-mail.


    Thanks.