Showing posts with label TestStackWhiteFramework. Show all posts
Showing posts with label TestStackWhiteFramework. Show all posts

How to find your application window/childwindow using TestStach.White

Try below code to find your application window/child windows by using TestStack.White framework -
Lets take NotePad as our application -

  //get the required window
  List windows = new List();            
  windows = Desktop.Instance.Windows(); 
  //Get all the windows on desktop            
  for (int i = 0; i < windows.Count; i++)
  {                
      string str = windows[i].Title;
      if (str.Contains("Notepad")) 
         //compare which window title is matching to your string
         {                    
         mainwindow = windows[i];
         //Log("mainwindow detected");
         break;                
         }
  }
  //pop out "Font" window from the notepad with the below keypress

  mainwindow.Keyboard.PressSpecialKey(KeyboardInput.SpecialKeys.ALT);            
  mainwindow.Keyboard.Enter("O");            
  mainwindow.Keyboard.Enter("F");

  //Find the Font window from the mainwindow (modal window)
  Window font = mainwindow.ModalWindow("Font");

Weblinks to know more about TestStack.White framework



A very useful weblink to know more about white framework from white.codeplex.com is HERE.

http://www.dreamincode.net/forums/topic/322108-c%23-teststackwhite-for-beginners/

http://blogs.msdn.com/b/john_daddamio/archive/2008/04/04/testing-wpf-applications-with-the-white-ui-test-framework.aspx

White: An UI Automation Tool for Windows Application

This is what I got till now with my searching thru internet, will be posting some more once get new links, please feel free to comment with new links if ever you find relevant to this, thanks!

http://teststack.azurewebsites.net/White/UIItems.html

Issues and fixes -
https://github.com/TestStack/White/issues?page=1&state=open

https://groups.google.com/forum/#!forum/teststack_white

 

Open source UI Automation testing using White framework

Most organizations encourage open source tools to implement automation testing of their products/softwares, and it indirectly encourages testers/programmers to expose more into difference technologies to find best automation tool and should be freely available, so here is what I found a very tiny yet powerful open source automation testing framework to automate the testing process, called White framework.
Hope this may be useful!!!

All you need is -
1) Visual Studio express edition (Completely free).
2) Knowledge in C#.
3) TestStack.White framework dlls.
4) UI automation verifier which we call object spy as testers. 
And at last but not the least - some web links/ forums to get the idea about programming.


Visual Studio Express Edition - 
Microsoft provides it as free edition to create windows forms and for writing class libraries and can download the same from HERE.

Knowledge in C# - 
Some of the web links that I follow frequently are -
http://www.dotnetperls.com/

http://msdn.microsoft.com/en-us/library/System.Windows.Forms.aspx

http://stackoverflow.com/

TestStack.White framework dlls - 

  • Once Visual Studio is installed, Open a new project as "Windows Forms Application" (Enter project Name, location - optional) and then,
  • From the Visual studio menu bar, follow this 











 

  • Once the install done, we will get the white framework dlls under the current visual studio project folder, e.g - C:\Users\\Documents\Visual Studio 2012\Projects\WindowsFormsApplication1\packages\
  • Now from File menu -> Add -> new Project and select class library (change name and lcoation - optional), this is where we write our functions or code to automate.
  • make sure we have added all the required dlls as reference to the class library from the solution explorer of visual studio, if not - do the following -                                                                               On the solution explorer - > click on the class library and add the dlls to the references by browsing proper location of package on the local drive.
  • dlls you may need initially - TestStack.White.dll and Castle.Core.dll.
UI automation verifier -
The UI spy can be downloaded from HERE.

All the best!!!