English 中文(简体)
Hudson imn t Seem to Ron Process. 明显开始
原标题:Hudson Doesn t Seem to Run Process.Start Correctly

就项目而言,我必须开始在C#中提出申请,与工艺有关的自动化树皮,然后关闭树木的应用和产出。 采用程序开放申请。 之后,我发现与 sp毛工艺有关的自动化设备,并利用树木瓦勒凯和FindFirst和FindAll方法的聚合而走树。

这在我的电脑上课以罚款,并在当地正确使用联尼特。 飞机还用我的电脑在其他人手中。 问题是,它从未在管理Hudson的中央测试服务器上运行。 经过几小时的脱胎之后,我对Hudson进行了测试,开始申请,然后印刷了自动化Tree的第一层。 在我的电脑上,我所有的窗户都在桌面上。 在Hudson,这只印刷了桌面。

我想可能有多个台式,我利用植根的树木Walker s GetNextSibling功能。 它只报告一个台式。

这里使用的是Im代码,用于启动程序。

public bool connect(string[] args)
{
    if (this.process != null) {
        Console.WriteLine("ERROR: Process already connected");
        return false;
    }

    if (!File.Exists(sApplicationPath)) {
        Console.WriteLine(sApplicationPath + " does not exist");
        return false;
    }

    // Turn the command arguments into a single string
    string arguments = "";
    foreach (string arg in args) {
        arguments += arg + " ";
    }

    try {
        // Start the application
        ProcessStartInfo processStartInfo =
            new ProcessStartInfo(sApplicationPath);
        processStartInfo.Arguments = arguments;
        this.process = Process.Start(processStartInfo);

        // Must be a positive integer (non-zero)
        if ( !( iInitialDelay > 0 )  ) {
            Console.WriteLine("Invalid initial delay. " +
                              "Defaulting to 5 seconds.");
            this.iInitialDelay = 5000;
        }

        Thread.Sleep(this.iInitialDelay);
    } catch (Exception ex) {
        Console.WriteLine("WGApplication.connect: " + ex.Message);
        return false;
    }

    // Check if the process still exists
    try {
        /** This part does not return an error, so I think that means the process exists and is started */
        Process check = Process.GetProcessById(process.Id);
    } catch (ArgumentException ex) {
        Console.WriteLine("The process expired before connection was complete");
        Console.WriteLine("Make sure the process is not open anywhere else");
        Console.WriteLine("and that it is able to execute on the host machine.");
        return false;
    }

    // Check if the base automation element exists to verify open
    AutomationElement rootWindow =
        AutomationElement.RootElement.FindChildProcessById(process.Id);
    /** This part returns null, so it can t find the window associated with this process id */

    if (this.process == null) {
        return false;
    } else if (rootWindow == null) {
        // A root window with this process id has not been found
        Console.WriteLine("Cannot find the root window of the created " +
                          "process. Unknown error.");
        return false;
    } else {
        // Everything is good to go
        return true;
    }
}

sApplicationPath is set to the absolute path of the executable. iInitialDelay is a delay to make sure the application has time to start. I m running this on C:WindowsSystem32 otepad.exe on Windows Vista SP2 and compiling it with the v3.5 C# compiler.

FindChildProcess a d 定义如下:

public static AutomationElement FindChildProcessById(
    this AutomationElement element, int processId)
{
    var result = element.FindChildByCondition(
        new PropertyCondition(AutomationElement.ProcessIdProperty,
                              processId));

    return result;
}

相信这在我的电脑上进行编辑和工作。 我对哈得德的测试方案说,根基部分根本没有儿童。

因此,我开始申请,确认申请已经存在,然后我可以找到与该程序相关的任何窗口。 除了桌面外,我找不到任何与任何东西相关的窗口。

这个问题是否与Hudson有关? 哈德逊是否以某种具体方式开展工作,该守则将不就此开展工作? 这是否与我的法典有关? 赫德森服务器正在使用Windows服务器2003年电脑。 希望得到任何帮助。 我知道这是一个非常具体的问题,这是我无法在线找到任何解决办法的原因。

最佳回答

是否Hudson作为服务? 如果是,它可能没有展示窗口的必要权利。

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签