question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

iOS platform: Screenshots are not honored in landscape mode

See original GitHub issue

For iOS 10.2 device, the screenshots are not capturing in landscape mode. By default they honored in Portrait mode even after setting the capability to landscape.

Environment:

Appium Version: Appium v1.7.2-beta MacOS : 10.13.2 Xcode: 8.3 Device: iPad Pro iOS: 10.2 JavaClient: 5.0.4

Capabilities Used:

 DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability("preventWDAAttachments", false);
        capabilities.setCapability("platformName", "ios");
        capabilities.setCapability("automationName", "XCUITest");
        capabilities.setCapability("realDeviceLogger", "idevicesyslog");
        capabilities.setCapability("platformVersion", "10.2");
        capabilities.setCapability("fullReset", false);
        capabilities.setCapability("useNewWDA", true);
        capabilities.setCapability("noReset", true);
        capabilities.setCapability("clearSystemFiles", true);
        capabilities.setCapability("xcodeOrgId", "xxxxxxxxx");
        capabilities.setCapability("xcodeSigningId", "iPhone Developer");
        capabilities.setCapability("deviceName", "xxxx iPad");
        capabilities.setCapability("deviceOrientation","landscape")
        capabilities.setCapability("newCommandTimeout", 100);
        capabilities.setCapability("udid", "bbbb");
        capabilities.setCapability("app", "/Users/ctl-user/Downloads/xxxxxx.ipa");
        println("Creating local iOS driver")
        return capabilities


Screenshotcode: 

BufferedImage takeScreenshot() 
{ 
     BufferedImage bufferedImage = null 
     Debug.setDebugLevel(3) 
      if (driver != null) { 
       File scrFile = driver.getScreenshotAs(OutputType.FILE) 
   try { 
       bufferedImage = ImageIO.read(scrFile) 
    } 
   catch (IOException e) 
  { 
       e.printStackTrace() 
} 
} 
  else 
{ 
  throw new ElementNotVisibleException("Element not found - ") 
} 
return bufferedImage 
}

My automation is completely based up on comparing the screens i.e Base VS target . For android platform it is working as expected. I am completely blocked due to this behavior.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:21 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
SatishCigniticommented, Nov 10, 2017

@mykola-mokhnach I verified the fix and is working as intended .

Thank you for the quick help @mykola-mokhnach , @imurchie

0reactions
lock[bot]commented, Apr 25, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix iPhone Screen Rotation Not Working after iOS 16.2 Update
Open Control center on iPhone X, Swipe finger down from top right notch of the screen. Find the rotate icon and Try with...
Read more >
Rotate the screen on your iPhone or iPod touch - Apple Support
If the screen still doesn't rotate, try a different app — like Safari or Messages — which are known to work in landscape...
Read more >
UIScrollView does not scroll in landscape mode - test code ...
Uncheck AutoResizeSubview of UIScrollView = NO in XIB under Drawing section and Check Clip SubViews. Refer to https://github.com/jayaprada- ...
Read more >
iPhone Screen Not Rotating to Landscape Mode? Here's How ...
You can use AssistiveTouch, an iOS feature that comes in handy when your iPhone Home button isn't working, to force rotate your iPhone's...
Read more >
Why create (or not) Landscape App Previews with Portrait ...
Zooms on the UI in a portrait App Preview can be done, but they often look awkward because you are still working with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found