MCPcopy Create free account
hub / github.com/callstack/agent-device / screenshot

Method screenshot

src/cloud-webdriver/webdriver-client.ts:158–166  ·  view source on GitHub ↗
(outPath: string)

Source from the content-addressed store, hash-verified

156 }
157
158 async screenshot(outPath: string): Promise<void> {
159 const value = await this.sessionRequest('GET', '/screenshot');
160 if (typeof value !== 'string') {
161 throw new AppError('COMMAND_FAILED', 'WebDriver screenshot response was not base64 text', {
162 valueType: typeof value,
163 });
164 }
165 await fs.writeFile(outPath, Buffer.from(value, 'base64'));
166 }
167
168 async windowRect(): Promise<WebDriverWindowRect> {
169 return readWindowRect(await this.sessionRequest('GET', '/window/rect'));

Calls 1

sessionRequestMethod · 0.95