Failed to Identify object, post takescreenshot

Hi Team,
We are trying to automate IOS application using appium. We are facing an issue that when we are capturing screenshot, driver fails to identify an object.
Tried using Appiumdriver as well as IOS driver. But still issue remains the same.
Same code is working fine on other macbooks.

Please help to resolve the concern.

loginButton.isDisplayed(); : Returns true
File file = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(file, new File(path));
loginButton.isDisplayed(); : Throws an exception

It’s a setup issue. You are going to have to find the differences in setup, what Mac OS, what Xcode, what Appium, etc.

Nobody will be able to tell you what this is without a log. But if you can get the setup the same (or at least close) to the other Macs where this is working you will be fine.

Setup is same in all Mac, same version is installed as both Mac are setup together.
Log does not have anything else except for cannot find an element with mentioned properties.

In same Mac, if we tried to capture screenshot sample web Selenium code, it is working fine.

Ok, so it works on one, but not on the other. Something is different. You are going to have to figure out what it is.