IronPython and White: Not found Application.cs

Jun 22, 2009 at 9:34 AM

Hey Guys.

I'm trying to use White framework with IronPython and just stuck in the begining. 

I have a simple script

---- 

import sys

sys.path.append("C:\Users\foo\Desktop\White Framework")

import clr

clr.AddReferenceToFile("White.Core.dll")

clr.AddReferenceToFile("White.NUnit.dll")

from Core import *

Application.Launch("iexplorer.exe");

window = application.GetWindow("bar", InitializeOption.NoCache);

--
And on got this weird error  on execucution:
c:/tests $ c:\Program\ Files/IronPython\ 2.0.1/ipy.exe test.py 
Traceback (most recent call last):
  File "test.py", line 7, in test.py
  File "d:\white\Core\Application.cs", line 40, in Launch
  File "d:\white\Core\Application.cs", line 50, in Launch
  File "System", line unknown, in Start
  File "System", line unknown, in Start
  File "System", line unknown, in StartWithShellExecuteEx
WindowsError: The system cannot find the file specifiedc:/tests $ 
Why "d:\white\Core\Application.cs" is referenced here? As you saw above, my white directory locates in the Desktop. 
FYI, I've downlead 0.17 build from the site, I didn't compile myself.
Any advice would be really helpful.
Thanks.

 

Coordinator
Jun 25, 2009 at 3:30 PM

do you have iexplore.exe in the path

Jul 8, 2009 at 9:58 AM

Hi

I too have similar problem

private void button1_Click(object sender, EventArgs e)
        {
            Core.Application app = Core.Application.Launch(@"C:\Program Files\AUT\aut.exe");
            Core.UIItems.WindowItems.Window wind = app.GetWindow("Aut");

            Core.UIItems.Label titleLabel = wind.Get<Core.UIItems.Label>("titleLabel");
--------

Source="White.Core"
  StackTrace:
       at Core.UIItems.UIItemContainer.Get(SearchCriteria searchCriteria) in d:\white\Core\UIItems\UIItemContainer.cs:line 92
       at Core.UIItems.UIItemContainer.Get[T](SearchCriteria searchCriteria) in d:\white\Core\UIItems\UIItemContainer.cs:line 73
       at Core.UIItems.UIItemContainer.Get[T](String primaryIdentification) in d:\white\Core\UIItems\UIItemContainer.cs:line 60
       at Core.UIItems.WindowItems.WinFormWindow.Get[T](String primaryIdentification) in d:\white\Core\UIItems\WindowItems\WinFormWindow.cs:line 43

Jul 8, 2009 at 3:10 PM
On Wed, Jul 8, 2009 at 4:58 PM, sanjaymadhav <notifications@codeplex.com> wrote:

From: sanjaymadhav

Hi

I too have similar problem

private void button1_Click(object sender, EventArgs e)
        {
            Core.Application app = Core.Application.Launch(@"C:\Program Files\AUT\aut.exe");
            Core.UIItems.WindowItems.Window wind = app.GetWindow("Aut");

            Core.UIItems.Label titleLabel = wind.Get<Core.UIItems.Label>("titleLabel");
--------

Source="White.Core"
  StackTrace:
       at Core.UIItems.UIItemContainer.Get(SearchCriteria searchCriteria) in d:\white\Core\UIItems\UIItemContainer.cs:line 92
       at Core.UIItems.UIItemContainer.Get[T](SearchCriteria searchCriteria) in d:\white\Core\UIItems\UIItemContainer.cs:line 73
       at Core.UIItems.UIItemContainer.Get[T](String primaryIdentification) in d:\white\Core\UIItems\UIItemContainer.cs:line 60
       at Core.UIItems.WindowItems.WinFormWindow.Get[T](String primaryIdentification) in d:\white\Core\UIItems\WindowItems\WinFormWindow.cs:line 43


Hm, don't sure that this is the same issue that I had. But in mine case, viveksingh was right. Actually, I've just misspelled the IE binary name :)

 

--
-kir-
Jul 9, 2009 at 6:04 AM
Edited Jul 9, 2009 at 12:59 PM

Hi,


In my case  it's different, I developed automation scripts using White 0.17 version which is working fine,

Now I have not modified any source for this. only updated dll version to 0.18, it's throwing this Exception

StackTrace:
       at Core.UIItems.UIItemContainer.Get(SearchCriteria searchCriteria) in d:\white\Core\UIItems\UIItemContainer.cs:line 92
       at Core.UIItems.UIItemContainer.Get[T](SearchCriteria searchCriteria) in d:\white\Core\UIItems\UIItemContainer.cs:line 73
       at Core.UIItems.UIItemContainer.Get[T](String primaryIdentification) in d:\white\Core\UIItems\UIItemContainer.cs:line 60
       at Core.UIItems.WindowItems.WinFormWindow.Get[T](String primaryIdentification) in d:\white\Core\UIItems\WindowItems\WinFormWindow.cs:line 43
       at WindowsApplication1.Form1.button1_Click(Object sender, EventArgs e) in C:\Documents and Settings\20002767\My Documents\Visual Studio 2005\Projects\WindowsApplication1\WindowsApplication1\Form1.cs:line 31
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ButtonBase.WndProc(Message& m)
       at System.Windows.Forms.Button.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(Form mainForm)
       at WindowsApplication1.Program.Main() in C:\Documents and Settings\20002767\My Documents\Visual Studio 2005\Projects\WindowsApplication1\WindowsApplication1\Program.cs:line 17
       at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()

Message:


AutomationId: MainForm
ControlType: ControlType.Window
Name: Kollmorgen WorkBench - Beta Release
HelpText:
Bounding rectangle: 132,174,792,560
ClassName: WindowsForms10.Window.8.app.0.378734a
IsOffScreen: False
FrameworkId: WinForm
ProcessId: 3336

System.Windows.Automation.WindowPattern
System.Windows.Automation.TransformPattern

    AutomationId: toolStripContainer1
    ControlType: ControlType.Pane
    Name: toolStripContainer1
    HelpText:
    Bounding rectangle: 136,228,784,502
    ClassName: WindowsForms10.Window.8.app.0.378734a
    IsOffScreen: False
    FrameworkId: WinForm
    ProcessId: 3336

        AutomationId: 2035812
        ControlType: ControlType.Pane
        Name:
        HelpText:
        Bounding rectangle: 136,253,784,477
        ClassName: WindowsForms10.Window.8.app.0.378734a
        IsOffScreen: False
        FrameworkId: WinForm
        ProcessId: 3336

            AutomationId: navigationSplitter
            ControlType: ControlType.Pane
            Name:
            HelpText:
            Bounding rectangle: 136,253,784,455
            ClassName: WindowsForms10.Window.8.app.0.378734a
            IsOffScreen: False
            FrameworkId: WinForm
            ProcessId: 3336

                AutomationId: 528590
                ControlType: ControlType.Pane
                Name:
                HelpText:
                Bounding rectangle: 136,253,176,455
                ClassName: WindowsForms10.Window.8.app.0.378734a
                IsOffScreen: False
                FrameworkId: WinForm
                ProcessId: 3336

                    AutomationId: navigationPanel
                    ControlType: ControlType.Pane
                    Name:
                    HelpText:
                    Bounding rectangle: 136,253,176,455
                    ClassName: WindowsForms10.Window.8.app.0.378734a
                    IsOffScreen: False
                    FrameworkId: WinForm
                    ProcessId: 3336

                        AutomationId: navigationTreeView
                        ControlType: ControlType.Tree
                        Name:
                        HelpText:
                        Bounding rectangle: 136,253,176,438
                        ClassName: WindowsForms10.SysTreeView32.app.0.378734a
                        IsOffScreen: False
                        FrameworkId: WinForm
                        ProcessId: 3336

                        System.Windows.Automation.SelectionPattern
                        System.Windows.Automation.ScrollPattern

 

What are the changes i need to do.

Coordinator
Jul 9, 2009 at 10:28 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.