Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Webpage Refresh
I have a function which refreshes a webpage in Internet Explorer using html element. I want it repeating again and again immediately when web page is loaded fully. It might take 0.5 seconds to 1.5 seconds to load page normally.

FUNCTION pagerefresh

int w=wait(30 WV win("Welcome To REALTrans - Internet Explorer" "IEFrame"))
Htm e=htm("U" "New Offers " "" w "1/1/2" 5 0x21 0)

Your help would be appreciated.
Thank you.
to make that function repeat you need to move the rep command
not tested may not work as expected
Function pagerefresh
Copy      Help
,int w=wait(30 WV win("Welcome To REALTrans - Internet Explorer" "IEFrame"))
,Htm e=htm("U" "New Offers " "" w "1/1/2" 5 0x21 0)

you will probably need to alter the code some..
You have put fixed delay of 1.5 which I don't want. I want to refresh immediately as the page loading is complete. If it load in 0.5 seconds then it should refresh immediately, if it loads in 1.5 seconds then it should refresh accordingly. So that is what I want. Let me know if anything is there which waits for page to load fully.
Thank you and waiting to hear from you.
you can adjust the delay or remove it.It was just added so the function doesn't max out your cpu
also can try example
instead of fixed wait
wait 0 I "";;;change to your website address
or specify more options in htm
read about htm and wait in qm help for more info. You may or may not need to adjust the speed of the function if it runs to fast may error or worse max out your cpu
That does not work, let me know if any other function or anything which can do this.
what is error?
please paste your code so can evaluate it better
see for more info on how to do this
Here are codes which refreshing constantly without waiting for page to load fully.

int w=wait(30 WV win("Welcome To REALTrans - Internet Explorer" "IEFrame"))
Htm e=htm("U" "New Offers " "" w "1/1/2" 5 0x21 30)
wait 0 I ""
When creating code for htm, in the "Find html element" dialog specify a wait time. Then the function will wait for the element. That is how we wait for "web page loaded".
As you can see there is already specified 30 seconds in my code of Htm element wait, let me know how it can repeat only after webpage loading is done.
The code should work. I cannot test.
Try to insert wait 0.3 before the wait 0 I line.
It depends on web page, maybe the page does not set "browser busy" state, then wait 0 I cannot wait.
If something in the web page changes when it is finished refreshing, try to capture a changed or created html element or accessible object, and wait for it. I cannot test, cannot give you the code.
That worked perfectly! Thanks a million!!!

Forum Jump:

Users browsing this thread: 1 Guest(s)