Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selector strategy 'xpath' is not supported #18

Closed
kimfaint opened this issue Apr 22, 2024 · 2 comments · Fixed by #20
Closed

Selector strategy 'xpath' is not supported #18

kimfaint opened this issue Apr 22, 2024 · 2 comments · Fixed by #20
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@kimfaint
Copy link

When running the following python code against both WinAppDriver and FlaUI.WebDriver I get an error from FlaUI.WebDriver:

from selenium import webdriver # using selenium 3.141.0

app = "notepad.exe"

capabilities = {
    "app": app,
    "appium:app": app,
    "platformName": "Windows",
}
session = webdriver.Remote(
    command_executor="http://127.0.0.1:4723", desired_capabilities=capabilities
)
session.find_element_by_class_name("Edit").send_keys("class_name\n")
session.find_element_by_xpath("//Edit").send_keys("xpath\n")

WinAppDriver

==========================================
POST /session/1FEE2949-B25E-48CB-B24E-358E126917F4/element HTTP/1.1
Accept: application/json
Accept-Encoding: identity
Content-Length: 90
Content-Type: application/json;charset=UTF-8
Host: 127.0.0.1:4723
User-Agent: selenium/3.141.0 (python windows)

{"using": "xpath", "value": "//Edit", "sessionId": "1FEE2949-B25E-48CB-B24E-358E126917F4"}
HTTP/1.1 200 OK
Content-Length: 96
Content-Type: application/json

{"sessionId":"1FEE2949-B25E-48CB-B24E-358E126917F4","status":0,"value":{"ELEMENT":"42.4329744"}}

FlaUI.WebDriver

info: Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker[3]
      Route matched with {action = "FindElement", controller = "FindElements"}. Executing controller action with signature System.Threading.Tasks.Task`1[Microsoft.AspNetCore.Mvc.ActionResult] FindElement(System.String, FlaUI.WebDriver.Models.FindElementRequest) on controller FlaUI.WebDriver.Controllers.FindElementsController (FlaUI.WebDriver).
fail: FlaUI.WebDriver.WebDriverResponseExceptionFilter[0]
      Returning WebDriver error response with error code unsupported operation
      FlaUI.WebDriver.WebDriverResponseException: Selector strategy 'xpath' is not supported
         at FlaUI.WebDriver.Controllers.FindElementsController.GetCondition(ConditionFactory conditionFactory, String using, String value)
         at FlaUI.WebDriver.Controllers.FindElementsController.FindElementFrom(Func`1 startNode, FindElementRequest findElementRequest, Session session)
         at FlaUI.WebDriver.Controllers.FindElementsController.FindElement(String sessionId, FindElementRequest findElementRequest)
         at lambda_method12(Closure , Object )
         at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
@aristotelos aristotelos added enhancement New feature or request good first issue Good for newcomers labels Apr 22, 2024
@aristotelos
Copy link
Collaborator

@kimfaint This is at the moment not supported, but possible to implement because FlaUI itself supports it.

@aristotelos
Copy link
Collaborator

Released with https://github.com/FlaUI/FlaUI.WebDriver/releases/tag/v0.1.1 now!

@aristotelos aristotelos self-assigned this Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants