Testing PictureBox in white

Jul 28, 2009 at 12:21 PM

Hello,

I am currently evaluating the White testing framework. Pretty amazing stuff!

Everything looks pretty promising, But I have run into a small wall.

How can I test a .NET 2.0 PictureBox?
There is no predefinied UIItem for that. Though there is the Image class, but how would I use that combination with my PictureBox?
I also tried to use a CustomUIItem, but with no success. How would I implement this for a my standard PictureBox?

What are my options? What did I miss?

Thanks

Coordinator
Jul 31, 2009 at 11:29 AM

can you do a window.LogStructure() and send across. want to check what a picture box is composed of.

Aug 27, 2009 at 7:10 AM
Edited Aug 27, 2009 at 7:21 AM

Sry for the ultra long delay but here it is:

---------------------------
---------------------------
AutomationId: Form1
ControlType: ControlType.Window
Name: Form1
HelpText:
Bounding rectangle: 154;203;680;490
ClassName: WindowsForms10.Window.8.app.0.378734a
IsOffScreen: False
    AutomationId: progressBar1
    ControlType: ControlType.ProgressBar
    Name:
    HelpText:
    Bounding rectangle: 198;488;190;23
    ClassName: WindowsForms10.msctls_progress32.app.0.378734a
    IsOffScreen: False
    AutomationId: Progress
    ControlType: ControlType.Button
    Name: Start Progress
    HelpText:
    Bounding rectangle: 198;459;190;23
    ClassName: WindowsForms10.BUTTON.app.0.378734a
    IsOffScreen: False
    AutomationId: PicBox
    ControlType: ControlType.Pane
    Name:
    HelpText:
    Bounding rectangle: 619;274;199;140
    ClassName: WindowsForms10.Window.8.app.0.378734a
    IsOffScreen: False

    AutomationId: PicCombo
    ControlType: ControlType.ComboBox
    Name:
    HelpText:
    Bounding rectangle: 619;247;199;21
    ClassName: WindowsForms10.COMBOBOX.app.0.378734a
    IsOffScreen: False
        AutomationId: 1001
        ControlType: ControlType.Edit
        Name:
        HelpText:
        Bounding rectangle: 622;250;176;15
        ClassName: Edit
        IsOffScreen: False
        AutomationId: ListBox
        ControlType: ControlType.List
        Name:
        HelpText:
        Bounding rectangle: 0;21;199;41
        ClassName: ComboLBox
        IsOffScreen: True
            AutomationId:
            ControlType: ControlType.ListItem
            Name: **********
            HelpText:
            Bounding rectangle: 1;22;197;13
            ClassName:
            IsOffScreen: True
            AutomationId:
            ControlType: ControlType.ListItem
            Name: **********
            HelpText:
            Bounding rectangle: 1;35;197;13
            ClassName:
            IsOffScreen: True
            AutomationId:
            ControlType: ControlType.ListItem
            Name: **********
            HelpText:
            Bounding rectangle: 1;48;197;13
            ClassName:
            IsOffScreen: True
        AutomationId: DropDown
        ControlType: ControlType.Button
        Name: Dropdown-Schaltfläche
        HelpText:
        Bounding rectangle: 800;248;17;19
        ClassName:
        IsOffScreen: False
    AutomationId: EditRadio
    ControlType: ControlType.RadioButton
    Name: Edit
    HelpText:
    Bounding rectangle: 198;420;43;17
    ClassName: WindowsForms10.BUTTON.app.0.378734a
    IsOffScreen: False
    AutomationId: ComboRadio
    ControlType: ControlType.RadioButton
    Name: Combo
    HelpText:
    Bounding rectangle: 198;397;58;17
    ClassName: WindowsForms10.BUTTON.app.0.378734a
    IsOffScreen: False
    AutomationId: tb1
    ControlType: ControlType.Edit
    Name:
    HelpText:
    Bounding rectangle: 198;303;190;20
    ClassName: WindowsForms10.EDIT.app.0.378734a
    IsOffScreen: False
    AutomationId: btn2
    ControlType: ControlType.Button
    Name: button1
    HelpText:
    Bounding rectangle: 198;274;190;23
    ClassName: WindowsForms10.BUTTON.app.0.378734a
    IsOffScreen: False
    AutomationId: btn1
    ControlType: ControlType.Button
    Name: button1
    HelpText:
    Bounding rectangle: 198;245;190;23
    ClassName: WindowsForms10.BUTTON.app.0.378734a
    IsOffScreen: False
    AutomationId: TitleBar
    ControlType: ControlType.TitleBar
    Name: Form1
    HelpText:
    Bounding rectangle: 158;207;672;26
    ClassName:
    IsOffScreen: False
        AutomationId: Form1
        ControlType: ControlType.MenuBar
        Name: Systemmenüleiste
        HelpText:
        Bounding rectangle: 158;207;18;25
        ClassName:
        IsOffScreen: False
            AutomationId: Item 1
            ControlType: ControlType.MenuItem
            Name: System
            HelpText:
            Bounding rectangle: 158;207;18;25
            ClassName:
            IsOffScreen: False
        AutomationId: Minimize
        ControlType: ControlType.Button
        Name: Minimieren
        HelpText:
        Bounding rectangle: 758;207;24;24
        ClassName:
        IsOffScreen: False
        AutomationId: Maximize
        ControlType: ControlType.Button
        Name: Maximieren
        HelpText:
        Bounding rectangle: 782;207;24;24
        ClassName:
        IsOffScreen: False
        AutomationId: Close
        ControlType: ControlType.Button
        Name: Schließen
        HelpText:
        Bounding rectangle: 806;207;24;24
        ClassName:
        IsOffScreen: False
---------------------------
OK   
---------------------------

 

Thanks a lot

Coordinator
Sep 4, 2009 at 4:01 AM

You can use the Panel class.

Sep 10, 2009 at 6:27 AM

How can I access the Image Proptery of the PictureBox now?

Thanks

Coordinator
Sep 20, 2009 at 6:28 AM

What do you expect to get from the Image property? Are are you looking to get the byte[] of the image?

Sep 21, 2009 at 6:46 AM

Yes! Thats what I am looking for.

Coordinator
Sep 27, 2009 at 4:20 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.