I reproduced it on examples javascript-webdriverio from the official repository.
Caps:
const iosWebCaps = {
platformName: 'iOS',
automationName: 'XCUITest',
deviceName: process.env.IOS_DEVICE_NAME || 'iPhone 6s',
browserName: 'Safari',
udid: 'auto',
platformVersion: '12.3.1',
startIWDP: 'true',
useNewWDA: 'true',
xcodeOrgId: 'id',
xcodeSigningId: 'iPhone Developer',
updatedWDABundleId: 'company.AppiumRunner'
};
test/basic/ios-create-web-session.test.js:
const webdriverio = require('webdriverio');
const iosOptions = require('../../helpers/caps').iosWebOptions;
const assert = require('chai').assert;
describe('Create Safari session', function () {
it('should create and destroy IOS Safari session', async function () {
const client = await webdriverio.remote(iosOptions);
await client.url('https://www.google.com');
const title = await client.getTitle();
assert.equal(title, 'Google');
let screenshot = client.saveScreenshot('./test-test.png');
await client.deleteSession();
});
});
I get a screenshot of the entire screen. Includes a line with WiFi / clock / battery, top / bottom safari panels.
test-test|281x499
By doing the same tests, but in android + chrome, I only get the browser area. As I need.
How can I get only the browser on iOS?