Unable to inspect picker elements of react-native-picker v1.7.2 component in Appium inspector for both Android and IOS - react-native

I work on test automation . I am trying to select an expiry date in the date picker component . App is implemented using react native. Developer has used date picker component available in https://github.com/xgfe/react-native-datepicker . But I am unable to see the android tags corresponding to the date picker in Appium inspector and UIAutomatorViewer. The app source looks like below
inspector app source
After the last android.view.ViewGroup tag , nothing is displayed for date picker in inspector.
As a workaround , we asked the developer to set ids for ‘Cancel’ and ‘Confirm’ buttons . So that atleast we can select first date and proceed . But the developer informed that the date picker is coming from reactive-native-picker library(1.7.2 version) . So they are unable to set any ids inside for the ‘Cancel’ and ‘Confirm’ buttons.
Please find the xml source which copied from inspector . There is no mention of the date picker element
xml source
Any help is appreciated . Thanks in advance.

Related

The accessibilityHint gets appended in the "accesibility id" in the appium inspector

When I am trying to add accessibilityLabel without accessibilityHint, I'm getting error that has accessibilityLabel prop but no accessibilityHinteslint(react-native-a11y/has-accessibility-hint). But on adding accessibilityHint it is being appended in the accessibility id in Appium inspector. like the following:
Just want to know if there a way to stop accessibilityHint from getting appended in the accessibilityLabel?

How do I create an clickable icon that shows a datepicker with multi date picker?

I'm working on a Vue.js project . I'd like to have an icon displaying a calendar, and when you click on the icon , you'll get a datepicker to choose multi date from.
How do I implement that?
I've looked at the docs:
and I've tried something like this:
align="right"
v-model="test"
icon="calendar"
:lang="lang"
:multi="multi"
:always-display="false"
>
</m-date-picker>```
but that doesn't working
What am I missing?

RN Picker.Item doesn't have accessibility label when opened in Appium

I am using React Native picker (#react-native-community/picker) to create picker fields in react native.
Now after building the APK, I ran the app in Appium. My aim is to using Appium to select the picker items. For that I need accessibilityId. So, I passed accessibilityLabel in Picker and Picker.Item.
But when I am inspecting the items I can't find any accessibilityId.
I want to perform the click operations and create test script, and I don't want to use the XPath. That's why I want accessibilityId. Is there any way to make accessibilityId available to Picker Items? Or is there any way to select these items and do click operations?
In your react code try to add accessibilityLabel in some kind of tag that generates native "View" tag in android. You can try wrap this picker element in <TouchableOpacity> and then add the label.
<TouchableOpacity accessibilityLabel="picker-mr">

How can i do custom date picker in react-native

I had used date time picker in react native, but I want to do in my custom UI for the date picker. How can I do it?
I want to do as shown in below image in both android and IOS
Follow the below steps.
Use new Date API to get Date, Month and Years store them in array.
then display in row so three are side to each other.
Hide Top and Bottom Portion View Using overflow hidden
That is it you can generate a Date Picker like you side.
You can get that look by using the react-native-date-picker library and the following code:
<DatePicker
date={date}
onDateChange={setDate}
mode="date"
/>

Unable to click button in mobile web in appium

After exhaustively searching for this over various forums, I still don't have an answer.
Here are complete details
I'm identifying the element through classname which points to multiple(4) buttons. I'm iterating through buttons and then search for text and when there is a match i click it.
This works fine with selenium webdriver and browsers such as firefox,chrome
Now I'm doing the same thing with appium.
Out of 4 buttons which are identified through classname, the script clicks 2 buttons successfully but for two buttons click happens(i can see the button being clicked) but new page which should be loaded is not loaded. The buttons for which click is not happening are in a footer class and other two are in div class.
Things i have already tried
Actions builder - click(), clickandhold()
Javascript executor
I'm currently trying with touch options, tap and by switching to native view but haven't found any success.
If any has encountered the same, a solution will be appreciated.
I want to avoid xPath because that might change in the page I'm working on, and I want to stress that the script is able to find the button, but is not able to click it properly.
You can filter your locator by using class name and index. Like this:
driver.findElementsByXPath("//*[#class='android.widget.ImageView' and #index='0']");
This xpath won't get change on other devices too.
Could you see: Unable to find an element in Browser of the Android emulator using Appium and C# ?
In case of testing web apps in browser the elements should be located as usual elements on the web page ( not as some classes like android.widget.EditText and android.widget.Button).
Upadting appium java client to 1.5.0 (from 1.3.0) solved the issue. Need to check why!