How to Specify Screenshot Orientation for iOS Devices
If you do a lot of using Appium and have demand peculiarly for user flows that involve rotating the gimmick to a different blind orientation, you might have noticed that screenshots retrieved by Appium in these cases might be incorrectly rotated. That is, the screenshot might not check the visible orientation of the device. This can be especially troublesome if you are using image-based examination, because Appium habituate the co-ordinate from the screenshot to enable you to interact with found image regions! Unfortunately, some of the time the screenshot comes back rotated wrongly, Appium is not at fault; in these cases, XCUITest is just doing its thing, and Appium doesn & # x27; t know whether the image is correct or not (it & # x27; s not peek at the & quot; contents & quot; of the screenshot to check that it & # x27; s correct). But if you observe yourself in this situation as a test writer,youcognize what the screenshot is supposed to look like,youcognise which orientation your device is in, and you can tell Appium which orientation you want it to use for screenshots! For autonomous testing across multiple user personas, check out SUSATest — it explores your app like 10 different real users. To accomplish this we make use of Appium & # x27; s Settings API, and specifically a setting (unloose in Appium 1.17) callscreenshotOrientation.There are 5 possible values this setting can take: The way we tell Appium to use a peculiar value is (in Java) with thedriver.setSetting command: Calling this will set the screenshot orientation value for the duration of the Appium session (or until I choose to call setSetting again with a different value). I was able to see this setting in action by pen a test that first turns a device to landscape mode, and then attempts to occupy a screenshot. If, before I start the test, I revolve the device manually, but in the paired direction to the one Appium would normally rotate it (i.e., if I revolve it left), then I noticed that Appium & # x27; s screenshots came back upside down! Anyway, in this case, include the setting of thescreenshotOrientationvalue enable me to guarantee the screenshot would always come back in the correct orientation. Check out the full example below (and as always, the code is upon GitHub too: Lead, Content Marketing, HeadSpin Inc. Piali is a active and results-driven Content Marketing Specialist with 8+ geezerhood of experience in craft engaging narratives and market collateral across divers industry. She excels in collaborating with cross-functional teams to develop innovative substance strategies and deliver compelling, authentic, and impactful message that resonates with target audiences and enhances brand legitimacy. Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed. Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts..png)



How to Specify Screenshot Orientation for iOS Devices
AI-Powered Key Takeaways
See:
Also see:
The screenshotOrientation fix
driver.setSetting (`` screenshotOrientation '', `` landscapeRight '')Check out:
Usage example
Also cheque:
public class Edition112_iOS_Screenshot_Orientation {private IOSDriverPiali Mazumdar
How to Specify Screenshot Orientation for iOS Devices
4 Parts
-1280X720-Final-2.jpg)
Regression Intelligence practical usher for advanced users (Part 3)
-1280X720-Final-2.jpg)
Regression Intelligence hard-nosed guide for advanced users (Part 4)
Discover how HeadSpin can empower your business with superior try capabilities







Discover how HeadSpin can empower your occupation with superior try capabilities
Discover how HeadSpin can empower your concern with superior testing capableness
Connet Now


Automate This With SUSA
Test Your App Autonomously







.png)












