Selenium 与 Appium:尝试单击可手动单击的元素,但无法在 C# 中进行自动化测试

问题描述 投票:0回答:1

我正在尝试使用 Selenium 和 Appium 对 C# 中的移动应用程序进行自动化测试。该应用程序是使用 Flutter 制作的,有一个部分我必须选择商品的购买日期(元素及其类和属性的图片如下所示): Purchase Date Element

我尝试使用以下方法单击该元素:

IWebElement calendrierBouton = Outil.Driver.FindElementsByClassName("android.view.View")[14];
calendrierBouton.Click(); 

但是,上面的代码并没有点击该元素。我尝试使用 IJavaScriptExecutor,但这也不起作用。代码如下:

((IJavaScriptExecutor)Outil.Driver).ExecuteScript("arguments[0].click();", calendrierBouton);

当我手动测试移动应用程序时,我可以单击此元素,它会弹出一个日历来选择购买日期:Manually Clicking on the Purchase Date Element

我使用BrowserStack平台来运行测试。我尝试使用 SendKeys() 方法在购买日期元素中键入日期,但这也不起作用。关于如何单击购买日期元素打开日历有什么建议吗?预先感谢!

flutter selenium-webdriver appium browserstack
1个回答
0
投票

您可以尝试使用不同的appium版本,看看是否有任何改进: https://www.browserstack.com/app-automate/capability

您还可以检查元素是否可以在 Appium Inspector 中搜索。

© www.soinside.com 2019 - 2024. All rights reserved.