I
I
Ivan_star2022-02-09 09:45:32
Python
Ivan_star, 2022-02-09 09:45:32

How to open a site in full scale in Chrome via Selenium (Python)?

Selenium opens the window of my interface on a large scale, therefore, it cannot click what is outside of visibility, although the object itself, which needs to be clicked on the page, is found (and this, as I understand it, is correct).
I found the Set Window Size keyword, in which you can pass width and height. The full page opens as
element.style {
width: 100%;
height: 100%;
}
But when I pass
SeleniumLibrary.Set Window Size 100% 100%
the test fails with
ValueError: Argument 'width' got value '100%' that cannot be converted to integer.

What am I doing wrong or is there any other way I can open the full size page?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Emelyanov, 2022-02-22
@sepulkary

Try, for example, self.driver.set_window_size(1400, 3000), i.e. just increase the window. Visually, it will go beyond the screen, but Selenium will "see" the element you need.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question