Click or drag to resize
Tesco SW, a.s.

ExtensionMethodsExecuteAsyncPromise Method

Spustí asynchronní skript, který vrací promise. Skript je spuštěn v kontextu současného okna nebo framu. Počká na doběhnutí promisu a vrátí jeho výsledek.

Namespace:  TescoSW.MW.UITests.Common
Assembly:  TescoSW.MW.UITests.Common (in TescoSW.MW.UITests.Common.dll) Version: 15.2.7099.36746
Syntax
C#
public static Object ExecuteAsyncPromise(
	this IJavaScriptExecutor executor,
	string script,
	params Object[] args
)

Parameters

executor
Type: IJavaScriptExecutor
Script executor
script
Type: SystemString
The JavaScript code to execute.
args
Type: SystemObject
The arguments to the script.

Return Value

Type: Object
The value returned by the script.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IJavaScriptExecutor. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks

The ExecuteScript(String, Object)method executes JavaScript in the context of the currently selected frame or window. This means that "document" will refer to the current document. If the script has a return value, then the following steps will be taken:

Arguments must be a number (which will be converted to a Int64), a Boolean, a String or a IWebElement. An exception will be thrown if the arguments do not meet these criteria. The arguments will be made available to the JavaScript via the "arguments" magic variable, as if the function were called via "Function.apply"

See Also