TestSampleApplication click() never clicks

Mar 2, 2011 at 9:53 AM

When I run the TestSampleApplication tests the tests always fail because the click() functions never complete. I get the following error in NUnit:

TestSampleApplication.Tests.CreateCustomerTest.Create:White.Core.UIItems.UIActionException : Couldn't find window with title Create Customer Step1 in process 3852, after waiting for 5000 ms

Name: Dashboard,  Bounds: 294,256,691,471 ProcessId: 3852, Modal: False

Name: TestSampleApplication - NUnit,  Bounds: -8,-8,1296,1000 ProcessId: 3856, Modal: False

Name: TestSampleApplication - Microsoft Visual Studio (Administrator),  Bounds: -8,-8,1296,1000 ProcessId: 3080, Modal: False

Name: white - View Discussion - Google Chrome,  Bounds: -32000,-32000,160,27 ProcessId: 3236, Modal: False

Name: Inbox - xxxxx@xxxx.com - Microsoft Outlook,  Bounds: -8,-8,1296,1000 ProcessId: 2548, Modal: False

Name: Buddy List,  Bounds: 1278,0,220,984 ProcessId: 3508, Modal: False

Name: System,  Bounds: -32000,-32000,160,27 ProcessId: 3028, Modal: False

 

My test looks like 

 

[Test]
        public void Create()
        {
            Application application = Application.Launch(@"C:\MyTestSampleApplication\TestSampleApplication\SampleApplication\SampleApplication\bin\Debug\SampleApplication.exe");
            Window window = application.GetWindow("Dashboard", InitializeOption.NoCache);
            if (window != null)
            {
                Console.WriteLine(window.Name);
                Hyperlink createCustomerLink = window.Get<Hyperlink>("createCustomer");

                if ( createCustomerLink != null )
                {
                    Console.WriteLine(createCustomerLink.Name);
                    createCustomerLink.Click();
                    Window step1 = application.GetWindow("Create Customer Step1", InitializeOption.NoCache);
                    step1.Get<TextBox>("nameTextBox").BulkText = "Rakesh Kumar";
                    step1.Get<TextBox>("ageTextBox").BulkText = "26";
                    step1.Get<Button>("nextButton").Click();
                    Window step2 = application.GetWindow("Create Customer Step2", InitializeOption.NoCache);
                    step2.Get<TextBox>("phoneNumberTextBox").BulkText = "123213213";
                    step2.Get<Button>("submitButton").Click();
                    application.Kill();
                }
                else
                {
                    Console.WriteLine("Hyperlink not found");
                }
            }
            else
            {
                Console.WriteLine("Application window not found");
            }
            
        }

and the text output I get is 

***** TestSampleApplication.Tests.CreateCustomerTest.CreateLog4Net not configured. Looked for file: C:\MyTestSampleApplication\TestSampleApplication\bin\Debug\log4net.config

Using RecheckDurationInMilliseconds=100 for Bricks/Bricks

Dashboard

Create Customer

Can anyone guess why click() never does a click although createCustomerLink seems to have a valid reference?

Mar 2, 2011 at 10:06 AM

Looks like a known issue http://white.codeplex.com/workitem/5276

Mar 2, 2011 at 8:51 PM

Hi

have you added the config settings to your appConfig? Try to increase the busy timeout.

 

If not have a look at Configuration

 

Throndorin