Can I expect the BrowserBack Key to Work?

zenfreak

Client
Регистрация
21.08.2013
Сообщения
249
Благодарностей
12
Баллы
18
Using this
Код:
Emulator.SendKey(instance.ActiveTab.Handle,System.Windows.Forms.Keys.BrowserBack, KeyboardEvent.Press);
doesn't seem to have any effect.

Does anyone know a way I can emulate a browser back?
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
Hi.

1. Get actual page link in variable
2. Click link to new page
3. Go to link got in first step with referrer to page you are now
 

zenfreak

Client
Регистрация
21.08.2013
Сообщения
249
Благодарностей
12
Баллы
18
I did not fully understand your solution. So I have this url http://example.com/article05.html and I've clicked on a link on that page, let's say http://example.com/article05-indepth.html and usually, this will open a popup that I can close by clicking a button but right now I get a "Page isn't available" and need to hit the back browser button.

I don't really know the initial url (http://example.com/article05.html) so I can visit that using http://example.com/article05-indepth.html as a referer as I think you are suggesting.

How can I get back to http://example.com/article05.html without knowing the url?
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
If clicking link there is pop up then back button is not active even in browser.

If honestly I also did not understand what You mean, but there is variable {-Page.Url-} so you can save that in any other variable BEFORE clicking any link. So in case you need to get back you use this variable.
 

zenfreak

Client
Регистрация
21.08.2013
Сообщения
249
Благодарностей
12
Баллы
18
Sorry for the misunderstanding. The popup I was referring to it's not a browser popup window but just a simple javascript popup so it's part of the same browser page. This happens when opening posts in the Instagram feed - when I click the post, a popup shows up and I can close it by clicking the X button or clicking anywhere outside the box and return to the feed I was into. But if for some reason, the post doesn't exist anymore, when I click, instead of showing the popup, I will be visiting a page like this one: https://www.instagram.com/p/Bgo3e-9FUXa/ with an error "Sorry, this page isn't available."

To get back to my feed I'll have to use the browser back button, otherwise, if simply visiting the feed URL, I will lose my current feed position! This is the main downside of visiting the previous URL vs using the browser back button.

I was advised to use this for emulating the browser back button: http://help.zennolab.com/en/v5/zennoposter/5.9/webframe.html#ZennoLab.CommandCenter~ZennoLab.CommandCenter.Tab~KeyEvent.html but not sure how to use it and what's role of the "alt", "ctrl", "shift" keyModifers.

I assume it should look something like this: instance.ActiveTab.KeyEvent("BrowserBack", "press", "ctrl"); but this doesn't work and, like I said, not sure why do I need alt, ctrl or shift for

Not sure why is this so hard to emulate as this should be part of the basic browser emulation
 
  • Спасибо
Реакции: EtaLasquera

EtaLasquera

Client
Регистрация
02.01.2017
Сообщения
526
Благодарностей
112
Баллы
43

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