Skip to content

Commit 8cf8574

Browse files
authored
Merge pull request #26 from g4-api/development
Development
2 parents e825c6f + 50c9a8c commit 8cf8574

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/G4.Plugins.Ui/Actions.User32.Manifests/SendUser32Keys.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
"w3c": "POST /session/{session id}/user32/value"
153153
},
154154
"scopes": [
155-
"Any"
155+
"WindowsNative"
156156
],
157157
"summary": [
158158
"The `SendUser32Keys` plugin simulates realistic typing of text into native Windows application elements using the User32 API, sending characters individually with configurable delays and keyboard layouts."

src/G4.Plugins.Ui/Actions.User32/SwitchKeyboardLayout.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,11 @@ protected override PluginResponseModel OnSend(PluginDataModel pluginData)
5656
// Sends a request to switch the keyboard layout.
5757
private static void SwitchLayout(IWebDriver driver, string keyboardLayout)
5858
{
59+
// Retrieve the session opaque key from the WebDriver instance.
60+
var session = ((IWebDriverSession)driver).Session.OpaqueKey;
61+
5962
// Define the endpoint route for switching keyboard layouts.
60-
const string route = "/user32/layouts";
63+
var route = $"/session/{session}/user32/layouts";
6164

6265
// Construct the full URL by combining the server address and the route.
6366
var url = driver.Invoker.ServerAddress.AbsoluteUri.TrimEnd('/') + route;

0 commit comments

Comments
 (0)