Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.

Switch to frame Version 13 (Java)

Action group: Browsers

...

Description 

The action switches the control focus on the currently active page to the specified frame. A frame is a separate, complete HTML document that, together with other HTML documents, can be displayed in a browser window. Frames can also be nested within a frame, and frames can also be nested within frames. Frames divide a web page into separate minicomics on the same screen, which are independent of each other. Each window can have its own address.

...

For a deeper understanding of the structure of frames and the principles of their construction, read the information on the links below:

Информация

More on frames: 

https://osipenkov.ru/iframe-tracking-gtm/

https://ru.wikipedia.org/wiki/%D0%A4%D1%80%D0%B5%D0%B9%D0%BC_(HTML)

https://www.tutorialspoint.com/html/html_frames.htm

An example of a robot scheme when switching between frames: Frames (1).robin-source

Technically, the action moves the control focus through the frame structure. This is done by specifying the target frame to move to and the search area of that frame.

Action icon 

Image RemovedImage Added

Settings of parameters

Свойство
Property
Описание
Description
Тип
Type
Пример заполнения
Filling example
Обязательность
Mandatory field
заполнения поля
Parameters

Параметры

Контекст

Контекст действия для работы с браузером
ContextAction context for working with the browser.Robin.Selenium
Контекст браузера
Browser context
Да
Yes

Элемент

Фрейм, как элемент для взаимодействия
ElementFrame as an element for interactionRobin.WebElement
/html/body/div[5]/div[4]/div/div

Нет

Имя

Имя фрейма

No
NameFrame nameRobin.String
iframeResult

No

Нет

Индекс

Индекс фрейма. Нумерация начинается с
IndexFrame index. Numbering starts from 0.Robin.Numeric
1

No

Нет

Область поиска фрейма

Область поиска фрейма. Доступно 3 варианта: текущий фрейм - поиск в рамках текущего фрейма; родительский фрейм - поиск в рамках родительского фрейма; вся страница - поиск в рамках всей страницы
Frame search areaFrame search area. There are 3 options available: current frame - search within the current frame; parent frame - search within the parent frame; entire page - search within the entire page.Robin.String
Родительский фреймНет

No

Special conditions of use

  • You can select and fill one of the optional parameters;

  • Frame elements are not available when working with page elements. In order to access the frame elements, you must switch to

  • it.
  • the frame;

  • When working with frame elements, page elements are not available. In order to continue working with page elements, you need to switch from the frame back to the page

  • .
  • ;

  • It is
  • You can also

  • possible to
  • switch back to the current tab

  • again
  • using the

  • "Switch
  • “Switch to

  • Tab"
  • Tab” action

  • .
  • ;

  • To determine the number of frames on the page and their attributes,

  • it is necessary
  • you need to use the developer console. The console is opened by pressing the F12 key in the browser where the iframe is displayed (if there is one on the page).

Browser page with the developer console open:

As part of the example of filling out the "Frame search area" field, consider a site with frames: https://www.tutorialspoint.com/html/html_frames.htm , as well as the robot scheme Frames (1).robin-source

...

Example of use

Task 1

Implement actions using the "Index" parameter and "Frame search area" parameter options.

  1. The Parent frame option - we will search in a frame that is a level higher than the current focus (frame), or when the focus is on the main page. There are 3 frames on the site (you can see them using the developer console). To switch to the third frame, let's fill in the parameters: 
    • Specify "2" in the "Index" field (frame numbering starts with zero).
    • Specify "Parent frame" in the "Frame search area" field.
    • Specify the open browser context in the "Context" field.
    • Specify "Parent frame" in the "Frame search area" field (as the focus is now on the main page)


 Image Modified

The frame (the one switched to) contains two frames.

Image Modified

2. The Current frame option - search for a frame inside the current frame. Let's switch to the frame with the text “This is main page and content from any link will be displayed here”. This is the second frame inside the current frame. Let's specify the action parameters:

    • Specify the open browser context in the "Context" field.
    • Specify 1 in the "Index" field (frame numbering starts with 0).
    • Specify value "Current frame" in the "Frame search area" field (search for a child frame in the current frame).

 
 Image Modified

Image Modified

Next, use the "Get Text" action to get the text from the frame (see attached robot scheme).

...