# Switch Frame

&#x20;Some pages have iframe and you have to use node Switch Frame to navigate. You have two choices Sub frame and main frame. If you choose a subframe you need to select the element of that frame and here you also set the timeout waiting. When you use other platform accounts to log into a platform, you may come across a situation like this: when you log into Tik Tok with a Google account, a new tab will appear outside the main tab to log in to your account. To control this sub-tab using a script, you need to use the Switch Frame node.\
\
Một số trang có iframe và bạn phải sử dụng nút Switch Frame để điều hướng. Bạn có hai lựa chọn Khung phụ và khung chính. Nếu chọn khung con bạn cần chọn element  của khung đó và ở đây bạn cũng đặt thời gian chờ. Giống như việc bạn đăng nhập vào một nền tảng thông qua các tài khoản nền tảng khác sẽ gặp trường hợp như thế này, VD: đăng nhập tik tok bằng tài khoản google thì nó sẽ hiện ra một tab ngoài tab chính để đăng nhập account google. Lúc này nếu muốn script điều khiển được tab phụ kia thì cần dùng node Switch Frame này.

<figure><img src="/files/amkEO6Z4xhe7upNsMYKH" alt=""><figcaption></figcaption></figure>

| parameter                 | illustrate                                                                                                                                                                                                                                                                                                                    |
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Sub frame: Select element | <p>Enter the frame's CSS selector, then you can perform actions on elements in the frame.</p><p></p><p>Nhập CSS selector của frame, sau đó bạn có thể thực hiện các hành động đối với các phần tử trong frame.</p>                                                                                                            |
| Sub frame: Main frame     | <p>When choosing main frame, the steps behind it will be affected on the main page of the website.</p><p></p><p>Khi chọn main frame thì các bước đằng sau đó sẽ được tác động lên trang chính của trang web.</p>                                                                                                              |
| Timeout waiting           | <p>Maximum waiting time. For example: 30000: If this step is not performed successfully within 30 seconds, the next step will be performed directly.</p><p></p><p>Thời gian chờ đợi tối đa. Ví dụ: 30000: Nếu bước này không được thực hiện thành công trong vòng 30 giây thì bước tiếp theo sẽ được thực hiện trực tiếp.</p> |

{% file src="/files/gJSpwUdyUXoTygf4zoX2" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hidemium.io/automation-user-manual/navigator/switch-frame.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
