Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Webpage Refresh
#1
Hi,
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"))
rep
Htm e=htm("U" "New Offers " "" w "1/1/2" 5 0x21 0)
e.Click


Your help would be appreciated.
Thank you.
#2
to make that function repeat you need to move the rep command
not tested may not work as expected
Function pagerefresh
Code:
Copy      Help
rep
,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)
,e.Click
,1.5

you will probably need to alter the code some..
#3
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.
#4
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 "http://www.quickmacros.com/forum";;;change to your website address
or specify more options in htm
#5
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
#6
That does not work, let me know if any other function or anything which can do this.
#7
what is error?
please paste your code so can evaluate it better
see http://www.quickmacros.com/forum/showthread.php?tid=786 for more info on how to do this
#8
Here are codes which refreshing constantly without waiting for page to load fully.

rep
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)
e.Click
wait 0 I "https://as.realtrans.com/webtop/default.html"
#9
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".
#10
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.
#11
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.
#12
That worked perfectly! Thanks a million!!!


Forum Jump:


Users browsing this thread: 1 Guest(s)