You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I was onboarding my application with appium mac2 driver with dotnet, and I was trying to run a simple test of clicking a button. It seemed to work with the python client, but the dotnet client none of the selectors work. Is there a limitation with this client to test macos applicaitons? Every error log points to how 'css selector' is not compatible no matter what element finding choice I use.
Environment
.NET client build version or git revision if you use some snapshot: DotNet 6
Desktop OS/version used to run Appium if necessary: macOS
Details
Please provide more details, if necessary.
Code To Reproduce Issue [ Good To Have ]
`using OpenQA.Selenium;
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.Mac;
namespace appiumtest;
public class Tests
{
private MacDriver _driver;
[OneTimeSetUp]
public void SetUp()
{
var serverUri = new Uri("http://127.0.0.1:4723/");
var driverOptions = new AppiumOptions()
{
PlatformName = "mac",
AutomationName = "mac2",
};
driverOptions.AddAdditionalAppiumOption("showServerLogs", true);
driverOptions.AddAdditionalAppiumOption("noReset", true);
driverOptions.AddAdditionalAppiumOption("bundleId", "MY_BUNDLE_ID");
driverOptions.AddAdditionalAppiumOption("appPath", "MY_PATH_TO_APP");
// NoReset assumes the app com.google.android is preinstalled on the emulator
_driver = new MacDriver(serverUri, driverOptions, TimeSpan.FromSeconds(180));
}
[OneTimeTearDown]
public void TearDown()
{
_driver.Dispose();
}
[Test]
public void TestSignIn()
{
_driver.FindElement(By.ClassName("XCUIElementTypeButton")).Click();
}
}`
Exception stack traces
ran dotnet test in the project
OpenQA.Selenium.InvalidSelectorException : Locator Strategy 'css selector' is not supported for this session; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#invalid-selector-exception
Stack Trace:
at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse, String commandToExecute)
at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary2 parameters) at OpenQA.Selenium.Appium.AppiumDriver.Execute(String driverCommandToExecute, Dictionary2 parameters)
at OpenQA.Selenium.WebDriver.FindElement(String mechanism, String value)
at OpenQA.Selenium.By.<.ctor>b__11_0(ISearchContext context)
at OpenQA.Selenium.By.FindElement(ISearchContext context)
at OpenQA.Selenium.WebDriver.FindElement(By by)
at OpenQA.Selenium.Appium.AppiumDriver.FindElement(By by)
at appiumtest.Tests.TestSignIn() in /Users/ajdali/Documents/NewUserService/PersistUserService/AutomationTests/UnitTest1.cs:line 38
The text was updated successfully, but these errors were encountered:
The selenium dotnet client now implements class name in terms of css selectors, which won't work for the mac driver. Use a different type of selector instead, like xpath or ios class chain.
@jlipps Shouldn't we hack this same way we do that in Java in Python?
Appium drivers still use name/id selectors even though they are not part of W3C spec. I assume xcuitest/uia2 driver only work because there is a custom CSS parser, which turns client CSS locators back into name/id.
oh, btw, I haven't completed, but selenium project had/have an idea to allow to set a custom selector like appium client to add their own selector/locator. So in the future, adding custom selector/locator will be more easier. but not yet I guess
Description
Hello, I was onboarding my application with appium mac2 driver with dotnet, and I was trying to run a simple test of clicking a button. It seemed to work with the python client, but the dotnet client none of the selectors work. Is there a limitation with this client to test macos applicaitons? Every error log points to how 'css selector' is not compatible no matter what element finding choice I use.
Environment
Details
Please provide more details, if necessary.
Code To Reproduce Issue [ Good To Have ]
`using OpenQA.Selenium;
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.Mac;
namespace appiumtest;
public class Tests
{
private MacDriver _driver;
}`
Exception stack traces
ran dotnet test in the project
OpenQA.Selenium.InvalidSelectorException : Locator Strategy 'css selector' is not supported for this session; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#invalid-selector-exception
Stack Trace:
at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse, String commandToExecute)
at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary
2 parameters) at OpenQA.Selenium.Appium.AppiumDriver.Execute(String driverCommandToExecute, Dictionary
2 parameters)at OpenQA.Selenium.WebDriver.FindElement(String mechanism, String value)
at OpenQA.Selenium.By.<.ctor>b__11_0(ISearchContext context)
at OpenQA.Selenium.By.FindElement(ISearchContext context)
at OpenQA.Selenium.WebDriver.FindElement(By by)
at OpenQA.Selenium.Appium.AppiumDriver.FindElement(By by)
at appiumtest.Tests.TestSignIn() in /Users/ajdali/Documents/NewUserService/PersistUserService/AutomationTests/UnitTest1.cs:line 38
The text was updated successfully, but these errors were encountered: