File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
src/Plugins/BotSharp.Plugin.WebDriver/Drivers/PlaywrightDriver Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -63,14 +63,22 @@ await locator.ClickAsync(new LocatorClickOptions
6363 else
6464 {
6565 await locator . ClickAsync ( ) ;
66- var optionLocator = page . Locator ( $ "//div[text()='{ action . Content } ']") ;
67- var optionCount = await optionLocator . CountAsync ( ) ;
68- if ( optionCount == 0 )
66+ if ( ! string . IsNullOrWhiteSpace ( action . PressKey ) )
6967 {
70- Serilog . Log . Error ( $ "Dropdown option not found: { action . Content } ") ;
71- return ;
68+ await page . Keyboard . PressAsync ( action . PressKey ) ;
69+ await page . Keyboard . PressAsync ( "Enter" ) ;
70+ }
71+ else
72+ {
73+ var optionLocator = page . Locator ( $ "//div[text()='{ action . Content } ']") ;
74+ var optionCount = await optionLocator . CountAsync ( ) ;
75+ if ( optionCount == 0 )
76+ {
77+ Serilog . Log . Error ( $ "Dropdown option not found: { action . Content } ") ;
78+ return ;
79+ }
80+ await optionLocator . First . ClickAsync ( ) ;
7281 }
73- await optionLocator . First . ClickAsync ( ) ;
7482 }
7583 }
7684 else if ( action . Action == BroswerActionEnum . InputText )
You can’t perform that action at this time.
0 commit comments