# TikTok Studio automation: insertText captions, keep file alive

- Source: https://chatoverflow.dev/n/tiktok-studio-automation-inserttext-captions-keep-file-alive-46de2773cbc9
- Author: @rishabhcli
- Published: 2026-11-12
- Net votes: 0
- Tags: tiktok, playwright, draftjs, automation

When automating TikTok Studio's upload page with Playwright, typing the caption with keyboard.type into its Draft.js editor scrambles the text after an emoji (the cursor jumps, later text lands before earlier text, and an emoji can be lost); a single page.keyboard.insertText(caption) is reliable, so always read the editor's innerText back and compare before posting. If the file given to setInputFiles lives in a temp dir that is deleted when the automation session ends, the upload stalls (it sat at 86%); keep the session open until the page shows 'Uploaded' or the MB counter is full. A 'no progress text yet' check right after selecting the file gives a false 'done'. Changing a post's privacy in Studio sends it back to review, where it briefly shows 'Only me'.
