Date fields not selecting properly

After recording, if we run test 3 to 4 times date fields not selecting properly one or two times can u plz help me on this

Can you share the scenario/ application?

THANK U for quick reply(https://play.google.com/store/apps/details?id=com.mgmresorts.mgmresorts&hl=en)
in MGM Resorts application

Open MGM RESORTS Application
Tap on services
Tap on Book a Room
Tap on DESTINATION drop down box
select Location as Mississippi
Tap on HIGH which is in Sort By Price
Tap on BEAU RIVAGE
Tap on calender
select ARRIVAL Date &DEPARTURE Date
Tap on GUESTS
Select number of 2GUESTS
Go to DELUXE QUEEN Room
Tap on Book this room
Validate for Location, Guest count, Arrival date and Departure date

hi,
As your application is hybrid app, I would recommend to use ‘Instrument’ flag in the capabilities.
Following is the test xml file:
MGM.xml (8.1 KB)

Following is the test java code:
    public void setUp() throws MalformedURLException {
        DesiredCapabilities dc = new DesiredCapabilities();
        dc.setCapability(SeeTestCapabilityType.REPORT_DIRECTORY, reportDirectory);
        dc.setCapability(SeeTestCapabilityType.REPORT_FORMAT, reportFormat);
        dc.setCapability(SeeTestCapabilityType.TEST_NAME, testName);
        dc.setCapability(MobileCapabilityType.UDID, "01157df1c0a40b0d");
        dc.setCapability(AndroidMobileCapabilityType.APP_PACKAGE, "com.mgmresorts.mgmresorts");
        dc.setCapability(AndroidMobileCapabilityType.APP_ACTIVITY, "com.mvl.mgmgrand.activities.SplashScreen");
        dc.setCapability(SeeTestCapabilityType.INSTRUMENT_APP, true);
        driver = new SeeTestAndroidDriver<>(new URL("http://"+host+":"+port), dc);
    }
    
    @Test
    public void testMGM() {
        new WebDriverWait(driver, 10).until(ExpectedConditions.presenceOfElementLocated(By.xpath("//*[@text='Book Room']")));
        driver.findElement(By.xpath("//*[@text='SERVICES']")).click();
        driver.findElement(By.xpath("//*[@text='Book a Room']")).click();
        driver.context("WEBVIEW_1");
        driver.sleep(7000);
        driver.findElement(By.xpath("//*[@class='ng-pristine ng-valid']")).click();
        driver.context("NATIVE_APP");
        driver.findElement(By.xpath("//*[@text='Mississippi']")).click();
        driver.context("WEBVIEW_1");
        driver.findElement(By.xpath("//*[@text='High']")).click();
        driver.findElement(By.xpath("//*[contains(@text,'Beau Rivage Resort')]")).click();
        driver.findElement(By.xpath("//*[@text='Junior Suite']")).click();
        driver.findElement(By.xpath("//*[@text='Junior Suite']/../..//*[@text='Book This Room']")).click();
        driver.findElement(By.xpath("//*[@text='Book This Room']")).click();
        driver.findElement(By.xpath("//*[@text='Beau Rivage']"));
    }

Thank you guy,How to set context value is there any parameters for that

Hi,
You can use the context command when you move from webview to native and back.
In the Appium Studio you can use the SetContext command.
BR,
Guy