OpenQA.Selenium.Remote.RemoteWebDriver.ConvertArgumentsToJavaScriptObjects C# (CSharp) 메소드

ConvertArgumentsToJavaScriptObjects() 개인적인 정적인 메소드

private static ConvertArgumentsToJavaScriptObjects ( object args ) : object[]
args object
리턴 object[]
        private static object[] ConvertArgumentsToJavaScriptObjects(object[] args)
        {
            for (int i = 0; i < args.Length; i++)
            {
                args[i] = ConvertObjectToJavaScriptObject(args[i]);
            }

            return args;
        }

Usage Example

예제 #1
0
        protected object ExecuteScriptCommand(string script, string commandName, params object[] args)
        {
            object[] array = RemoteWebDriver.ConvertArgumentsToJavaScriptObjects(args);
            Dictionary <string, object> dictionary = new Dictionary <string, object>();

            dictionary.Add("script", script);
            if (array != null && array.Length > 0)
            {
                dictionary.Add("args", array);
            }
            else
            {
                dictionary.Add("args", new object[0]);
            }
            Response response = this.Execute(commandName, dictionary);

            return(this.ParseJavaScriptReturnValue(response.Value));
        }