2009-07-28 15 views
0

現在、ホワイトテストフレームワークを評価中です。かなり素晴らしいもの!ピクチャボックスを白でテストする

すべてはかなり有望ですが、私は小さい壁にぶつかりました。

.NET 2.0 PictureBoxをテストするにはどうすればよいですか?
これには事前定義されたUIItemはありません。 Imageクラスはありますが、PictureBoxと組み合わせて使用​​するにはどうすればいいですか?
また、CustomUIItemを使用しようとしましたが、成功しませんでした。自分の標準PictureBoxのためにこれを実装するにはどうすればよいですか?

私のオプションは何ですか?私は何を取りこぼしたか?ただ、clearifyする

おかげ




私はこのような何かがコードでテストされるべきであることを知っています。私を信じてください。しかし残念ながら、この自動化の自動化は、不幸なことに、必要なものです。

私はたぶん画像の場所などを取得する必要があります。ちょうど私がどのWinForms TextBoxでもテキストを取得できるように。


更新:

これは私の窓のためのDebug.Detailsのダンプです。私はこれが私の問題を理解し、うまくいけば解決するのを助けることを望みます。

--------------------------- 
--------------------------- 
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 
--------------------------- 

答えて

-2

あなたは正確に何を試そうとしていますか?

あなたはフレームワークを信頼してはいけない場合を除き、私は、私は自分のコードをテストしたい

+0

...、MSはすでにフレームワークでコントロールをテストしており、さらに、ユーザーテストを必要とすべきではないと確信しています。評価のためだけ。私はWinFormsを自動化したい。画像検索は簡単ではありません。そして、私は今、正しい画像がmy PictureBoxに表示されているかどうかをテストしたいと思います。私はおそらくこれをコードでテストすることができます。しかし、残念なことに、「視覚経路」は要件である。私は別にそれをやっただろう... – eric

+0

どのように視覚的な外観をテストしますか?スクリーンショットや何かと比較しない限り、それは非常に可能だとは思わない。 – leppie

+0

画像や何かのパスだけではありません。 TextBox.TextのようにPictureBox.Imageを取得できるようにしたい – eric

関連する問題