I’m trying to automate tests for a mobile application in C# using Selenium with Appium. This application was made using Flutter and there is a section where I have to select the purchase date for an item (picture of the element with its class and attributes are shown below):
Purchase Date Element
I tried clicking on the element using this:
IWebElement calendrierBouton = Outil.Driver.FindElementsByClassName("android.view.View")[14];
calendrierBouton.Click();
However, the code above doesn’t click on the element. I tried using IJavaScriptExecutor and this doesn’t work either. The code for this is seen here:
((IJavaScriptExecutor)Outil.Driver).ExecuteScript("arguments[0].click();", calendrierBouton);
When I test the mobile application manually, I’m able to click on this element, and it brings up a calendar to select the purchase date: Manually Clicking on the Purchase Date Element
I’m using the BrowserStack platform to run the test. I tried using the SendKeys() method to type the date within the purchase date element, but this doesn’t work either. Any advice on how I can click on the purchase date element to open the calendar?
2
Answers
You can try using different appium versions to see if there is any improvement:
https://www.browserstack.com/app-automate/capabilities
You can also check the elements if they are searchable in Appium Inspector.
Are you able to click on a real device without using BrowserStack?
Try to get the locater using Appium Inspector. Please take a look at the attached document to use Appium Inspector with BrowserStack.
https://www.browserstack.com/docs/app-automate/appium/integrations/appium-desktop