Letractively / autotester

Automatically exported from code.google.com/p/autotester
1 stars 1 forks source link

how to use your program, thank you ~ #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
不好意思,跟您請教一下,我執行下面的程式,不過,開啟��
�覽器後,網頁會出現
about:blank,

如圖,請問這要怎麼使用呀?
using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using System.Threading;
using System.Drawing;

using Shrinerain.AutoTester.HTMLUtility;
using Shrinerain.AutoTester.Core;

namespace Shrinerain.AutoTester
{
    class Baidu
    {
        public static void Main()
        {
            string url = @"www.baidu.com";
        string title="百度一下,你就知道      ";
            HTMLTest test = new HTMLTest();
            //test.SendMsgOnly = true;

            test.Browser.Load(url);
        test.Browser.Find(title);
            //test.Map.TextBox().Input("測試");
        //test.Map.Button("百度一下").Click();
        //Console.ReadLine();         
        }
    }
}

my mail: flylon@gmail.com
不好意思,麻煩您了,非常謝謝你
可以的話,可否回我一下,感謝

Original issue reported on code.google.com by fly...@gmail.com on 3 Apr 2009 at 10:33

Attachments:

GoogleCodeExporter commented 9 years ago
error message 

未處理的例外狀況: 未處理的例外狀況: 
Shrinerain.AutoTester.Core.CannotStartBrowse
rException: Can not start test browser.
   於 Shrinerain.AutoTester.Core.TestBrowser.Start()
   於 Shrinerain.AutoTester.Core.TestBrowser.Load(String url)
   於 Shrinerain.AutoTester.Baidu.Main()
Shrinerain.AutoTester.Core.CannotAttachBrowserException: Can not hook test brows
er.
   於 Shrinerain.AutoTester.Core.TestBrowser.AttachBrowser(IntPtr ieHandle)
   於 Shrinerain.AutoTester.Core.TestBrowser.WaitForBrowserExist(String title, I
nt32 seconds)
   於 Shrinerain.AutoTester.Core.TestBrowser.WaitForBrowserExist()
   於 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   於 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, C
ontextCallback callback, Object state)
   於 System.Threading.ThreadHelper.ThreadStart()

Original comment by fly...@gmail.com on 3 Apr 2009 at 10:36

GoogleCodeExporter commented 9 years ago

我觉得你的代码就不对

异常已经很明显了  CannotStartBrowse
没有调用start方法。好比没开灯就进房间当然要撞墙了

我是这样写的
TestSession ts = new HTMLTestSession();
ts.Browser.Start("www.baidu.com");//启动浏览器并打开网址

或者
TestSession ts = new HTMLTestSession();
ts.Browser.Start();//启动浏览器
ts.Browser.Load("www.baidu.com", true);//打开网址

Original comment by dogsl...@sina.com on 20 Jul 2009 at 3:58