Speed Up Time Passing (delay of a form field) of the Browser with Javascript Command or UI.Vision


I’m working with JavaScript and UI.Vision to automate some tasks on a webpage I use a lot on Chrome.

The webpage has a form field which has some sort of embedded waiting time. After you finish typing, it waits like 10 seconds to give you the answer you need. I need to do that multiple times every time a customer comes.

I think it’s a mechanism similar to the one describe on the answer to this question (Run javascript function when user finishes typing instead of on key up?). It’s clearly design to wait the user to finish typing. But when someone is using UI.Vision to fill the form, it`s not necessary at all.

I would like that UI.Vision could input the value on the field and the page would instantaneously give me the answer. How could I do that?

I thought that maybe it would be possible to speed up the time passing of the browser? Maybe by running a script on UI.Vision or on the Console of Chrome itself? Or maybe could I trick somehow the time passing of Chrome or Windows?

I don`t know how Chrome or Windows measures time when the page has a delay function.

I’ve tried already to change the browser time moments after I’ve typed something, like suggested here: Change browser time to test return value of Date()?. And Ive tried to change the Windows time after I’ve typed something. It havent worked. So I thought that maybe it would be possible to set Chrome so time passes faster on the browser through a function in “executeJavaScript”.

Could someone teach me how to do that? Or does someone have another idea to solve this problem? Thank you very much!

You would need to manipulate the Javascript of this website. The command executeScript can be used for that. But finding the Javascript code for this tweak requires you to debug and understand the page source code.

1 Like