0

I am using selenium webdriver to navigate to website and send keys. It is working fine in development environment/computer. But I am getting error, when im trying to run through different computer.

namespace McaidWebToolImport
{
  class Program
  {
    static void Main(string[] args)
    {
        Console.WriteLine("Enter the batch number: ");
        string batchnumber = Console.ReadLine();

        if (batchnumber != "")
        {
            IWebDriver driver1 = new InternetExplorerDriver(@"C:\IEDriverServer\");
            driver1.Navigate().GoToUrl("http://website.com/webtool/physPop.asp?b=" + batchnumber);

            System.Threading.Thread.Sleep(2000);
            driver1.Quit();                
        }
        else
        {
            Console.WriteLine("Re-run the application with valid batch number");
            Console.WriteLine("\n\nPress Esacpe key (Esc) to exit");                
            while (Console.ReadKey(true).Key != ConsoleKey.Escape);             
        }
    }
  }
}
4

1 回答 1

0

您可以尝试处理异常(try/catch),然后您可以检查 InnerException 并获取有关失败原因的更多详细信息。

可能是您的开发机器上存在但目标机器上不存在的程序集。

于 2012-11-26T15:05:51.820 回答