2017-10-16 8 views
2

WebDAVをインスタンス化するときにAzure関数のC#コードからSelenium WebDriver.dllを使用しようとしましたが、次の問題があります。Azure WebDriver.dllを使用したAzure関数

エラー:

2017-10-16T20:02:25.169 Exception while executing function: Functions.fnTestSelenium. Microsoft.Azure.WebJobs.Script: One or more errors occurred. mscorlib: The path is not of a legal form.2017-10-16T20:02:25.278 Function completed (Failure, Id=2fcb928f-ee39-4cfe-99f2-4be2d57e91b2, Duration=843ms)

コード

#r "D:\ホーム\サイト\ wwwrootの\ fnTestSelenium \ binに\ WebDriver.dll" はSystem.Net使用します。

using OpenQA.Selenium; 
using OpenQA.Selenium.Firefox; 

public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log) 
{ 
    log.Info("C# HTTP trigger function processed a request."); 

    IWebDriver driver=new FirefoxDriver(); 
    // parse query parameter 
    string name = req.GetQueryNameValuePairs() 
     .FirstOrDefault(q => string.Compare(q.Key, "name", true) == 0) 
     .Value; 

    // Get request body 
    dynamic data = await req.Content.ReadAsAsync<object>(); 

    // Set name to query string or body data 
    name = name ?? data?.name; 

    return name == null 
     ? req.CreateResponse(HttpStatusCode.BadRequest, "Please pass a name on the query string or in the request body") 
     : req.CreateResponse(HttpStatusCode.OK, "Hello " + name); 
} 
+0

コードをコードとして適切に書式設定するには分、コメント(>)タグを付けたエラーメッセージ、見出しスタイルを削除するなどして読みやすくなります。 – JeffC

答えて

2

私はあなたがAzureの機能上のセレンを実行している多くの成功を持っていないと思います。

Azureの機能は、Webアプリケーションやモバイルアプリケーションのように、App Serviceで実行されます。 App Serviceは、特定の制限を課すサンドボックスと呼ばれる安全な環境で動作します。その中でも、GDI +の使用があります。

あなたが底部に向かってチェックする場合は、サポートされていないのリストにSelenimumが表示されます、サポートされていないフレームワークhttps://github.com/projectkudu/kudu/wiki/Azure-Web-App-sandbox#unsupported-frameworks

のリストとともに、制限のリストを見ることができます:取ってください

Other scenarios that are not supported:

PhantomJS/Selenium: tries to connect to local address, and also uses GDI+.

関連する問題