Scroll to element?

PHaRTnONu

Client
Регистрация
01.10.2016
Сообщения
340
Благодарностей
48
Баллы
28
so onfocus works in action designer but when i add it to project it doesn't actual take me tot he element...
i can grab the element id and place it in a zenno variable but i cant seem to get the project to scroll to the element....

any help here (c# or java would be nice if a zenno tools not available for it)
 

PHaRTnONu

Client
Регистрация
01.10.2016
Сообщения
340
Благодарностей
48
Баллы
28
Код:
instance.ActiveTab.WaitDownloading();
HtmlElement he = instance.ActiveTab.MainDocument.FindElementByAttribute("textarea", "name", "text", "text", 0);
if (!he.IsVoid)
{
    he.ScrollIntoView();
}
Код:
instance.ActiveTab.WaitDownloading();
HtmlElement he = instance.ActiveTab.MainDocument.FindElementByAttribute("div", "id", "div", "Variable6", 0);
if (!he.IsVoid)
{
  he.ScrollIntoView();
}
ok...
problem is im looking for div id element name with my own var set by zenno.... not working... any help here zortexx?
 

zortexx

Client
Регистрация
19.09.2011
Сообщения
2 520
Благодарностей
1 221
Баллы
113
Код:
instance.ActiveTab.WaitDownloading();
HtmlElement he = instance.ActiveTab.MainDocument.FindElementByAttribute("textarea", "name", "text", "text", 0);
if (!he.IsVoid)
{
    he.ScrollIntoView();
}
Код:
instance.ActiveTab.WaitDownloading();
HtmlElement he = instance.ActiveTab.MainDocument.FindElementByAttribute("div", "id", "div", "Variable6", 0);
if (!he.IsVoid)
{
  he.ScrollIntoView();
}
ok...
problem is im looking for div id element name with my own var set by zenno.... not working... any help here zortexx?
To use variable from zenno in C# you should do like this:
C#:
HtmlElement he = instance.ActiveTab.MainDocument.FindElementByAttribute("div", "id", "div", project.Variables["Variable6"].Value, 0);
The simplest way is you show me the website url and element.
If you cannot by any reason it will be difficult to help.
Because you know, the devil is in the details :-))
 

PHaRTnONu

Client
Регистрация
01.10.2016
Сообщения
340
Благодарностей
48
Баллы
28

PHaRTnONu

Client
Регистрация
01.10.2016
Сообщения
340
Благодарностей
48
Баллы
28
yeh not working.....
so here is what im grabing is the id name
out of the div tag's and i just want to scroll to the element....

cant seem to get this to work

Untitled.png
 

zortexx

Client
Регистрация
19.09.2011
Сообщения
2 520
Благодарностей
1 221
Баллы
113

zortexx

Client
Регистрация
19.09.2011
Сообщения
2 520
Благодарностей
1 221
Баллы
113

PHaRTnONu

Client
Регистрация
01.10.2016
Сообщения
340
Благодарностей
48
Баллы
28
Can you link that please?
 

PHaRTnONu

Client
Регистрация
01.10.2016
Сообщения
340
Благодарностей
48
Баллы
28
can you paste that in
Код:
 please
 

zortexx

Client
Регистрация
19.09.2011
Сообщения
2 520
Благодарностей
1 221
Баллы
113
can you paste that in
Код:
 please
You are welcome :-)

For the correct operation of the code, you should have pre-authorized profile with cookies and other stuff loaded.
I hope the code is clear as tip of the iceberg :-)

C#:
instance.ActiveTab.Navigate("https://www.facebook.com/unity3d/?fref=ts", "");

instance.ActiveTab.WaitDownloading();
HtmlElement he11 = instance.ActiveTab.FindElementByAttribute("div", "class", "UFIAddCommentInput.*", "regexp", 2);
HtmlElement he22 = instance.ActiveTab.FindElementByAttribute("div", "class", "UFILikeLink.*", "regexp", 1);
instance.WaitFieldEmulationDelay();
he22.ScrollIntoView();
instance.ActiveTab.WaitDownloading();
he11.RiseEvent("focus", instance.EmulationLevel);
he11.RiseEvent("click", instance.EmulationLevel);
instance.SendText("Hello from Zortexx...", 76);
 

PHaRTnONu

Client
Регистрация
01.10.2016
Сообщения
340
Благодарностей
48
Баллы
28
yeh does not work with out the focusing on the text area....
tried many variation of
Код:
instance.ActiveTab.WaitDownloading();
HtmlElement he11 = instance.ActiveTab.FindElementByAttribute("div", "id", "hyperfeed_story_id_*", "regex", 2);
instance.WaitFieldEmulationDelay();
he11.ScrollIntoView();
instance.ActiveTab.WaitDownloading();
when at the botem of the page just to see if it would tke it back to the top.... no luck
 

zortexx

Client
Регистрация
19.09.2011
Сообщения
2 520
Благодарностей
1 221
Баллы
113
yeh does not work with out the focusing on the text area....
tried many variation of
Код:
instance.ActiveTab.WaitDownloading();
HtmlElement he11 = instance.ActiveTab.FindElementByAttribute("div", "id", "hyperfeed_story_id_*", "regex", 2);
instance.WaitFieldEmulationDelay();
he11.ScrollIntoView();
instance.ActiveTab.WaitDownloading();
when at the botem of the page just to see if it would tke it back to the top.... no luck
Because FB coders are not lame :-))
I tell you something.
The text field does not exists in DOM before you put the part of the page that consists it into the visible side. (Scroll the page to make element visible the screen).

So if you need to put a comment, you should scroll to the element before the text field to place input:text into the visible part of the screen. Click on it and type text what you want.

I am not native so I hope you understand what I mean :-))
 

PHaRTnONu

Client
Регистрация
01.10.2016
Сообщения
340
Благодарностей
48
Баллы
28
So if you need to put a comment, you should scroll to the element before the text field
Yes I understand this.
But I loaded whole page 30/40+ post and told it to scroll back to post two.
It did nothing.
Clicking in field will bring it in view but I wanted to do a scroll into view before that action or for other reasons.
Scroll by element never works... lol
Clicking in field will but that's not always my action.
 

zortexx

Client
Регистрация
19.09.2011
Сообщения
2 520
Благодарностей
1 221
Баллы
113
It happened because every time when you scroll the page in FB something changing.
Especially wysiwyg:div.

UPD: just try to reload the page and find this element:

upload_2017-4-7_10-49-7.png


After that scroll page down few times. To guarantee there were 10-15 text fields like this:

upload_2017-4-7_10-50-53.png


Even if you scroll but not click on it the element cannot be found in Action Designer.
After you click you will find only fields that you clicked in.

upload_2017-4-7_10-57-4.png


This is why I recommend you to change the method of posting or element searching.
 
Последнее редактирование:

PHaRTnONu

Client
Регистрация
01.10.2016
Сообщения
340
Благодарностей
48
Баллы
28
every page has hyperfeed_story_id_
and you can just tell it to go to match 0 onward to scroll to the newest message on the feed.

even if i load with more then one and scroll down and try using it to scrool to 0 it WILL not work.
i know all about them changing tags that shouldnt matter if the hyperfeed story always exsit for the event. all i want to do is scroll to hyperfeed_story_id* 1 then 2 then 3 and so on and when there loaded to the point i want to return to 0 and start other process.

Untitled.png
 

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