FullEmulationMouseMoveToHtmlElement()

sowe

Новичок
Регистрация
22.10.2020
Сообщения
19
Благодарностей
0
Баллы
1
Hey!

I've been trying to move the mouse to a certain HTML element which definitely exists in the DOM (double checked it with SendInfoLog (HtmlText)). The cursor starts moving, but stops when reached bottom of the site - he needs to scroll to reach the right element.

EDIT: There is also a mysterious thing happening: Sometimes the "Cursor" is moving slowly to the bottom of the page (where he stops), and sometimes the cursor just appears at the bottom position.

Do I miss something here?

Best regards,
 

sowe

Новичок
Регистрация
22.10.2020
Сообщения
19
Благодарностей
0
Баллы
1
EDIT2: For HTMLElements which are visible (no scrolling necessary) it works like a charm - but as soon as the element is not in the "visible area", the function just moves to the bottom of the browser and stops. Are there any best practices for that case?
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
Does not seem there is any problems: https://i.imgur.com/mT38CXS.gif
Yes, sometimes it first moves to the end of the page and then moves back over the exact element.
Maybe that's some particular page case only?
 

sowe

Новичок
Регистрация
22.10.2020
Сообщения
19
Благодарностей
0
Баллы
1
Yes, I think so - there might be an issue with the resolution at all. I've also tried to place the cursor first to a bit lower position, since there is a "sticky header" on the site - but this doesn't work either.

Do you have any suggestions?
 

nicanil

Client
Регистрация
06.03.2016
Сообщения
2 242
Благодарностей
1 820
Баллы
113
Try to use FullEmulationMouseWheel to scroll HtmlElement into view and then FullEmulationMouseMoveToHtmlElement.
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
Yes, I think so - there might be an issue with the resolution at all. I've also tried to place the cursor first to a bit lower position, since there is a "sticky header" on the site - but this doesn't work either.

Do you have any suggestions?
First, have to get clear if that's a particular page problem, or maybe you use some wrong code.
Would You mind posting the page URL and what element you want to click. ?
 

sowe

Новичок
Регистрация
22.10.2020
Сообщения
19
Благодарностей
0
Баллы
1
Finally figured it out. I am using htmlElement.ScrollIntoView() first and afterwards FullEmulation...

Thanks anyway!
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)