Lucas 1 Posted September 24, 2013 Report Share Posted September 24, 2013 (edited) How do you wait in your code? I tried "Wait for browser event" in my script and noticed that at times it wasn't enough. Certain commands didn't work until I put an additional "wait 3 seconds" before them. How do you approach your wait steps? What's the best way? Do you use: Wait for browser event Wait for element Wait Or a combination? Edited September 24, 2013 by Lucas Quote Link to post Share on other sites
HelloInsomnia 1103 Posted September 24, 2013 Report Share Posted September 24, 2013 Probably a combination of both, wait for browser event - everything loaded. Then wait for the element you want to use just to be safe. You may also want to add wait 1 second after that even. 1 Quote Link to post Share on other sites
Ptrick125 45 Posted September 24, 2013 Report Share Posted September 24, 2013 For me, it just depends on the circumstances... Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted September 24, 2013 Report Share Posted September 24, 2013 I do "wait for element" most always. But I choose something on the bottom of the page and use inner text<<<important or submit button and use innertext when ever possible. navigate("http://www.ubotstudio.com/resources", "Wait")wait for element(<innertext="Our Blog">, "", "Appear") or choose the last element that you need. 1 Quote Link to post Share on other sites
Enigma 78 Posted September 24, 2013 Report Share Posted September 24, 2013 I do "wait for element" most always. But I choose something on the bottom of the page and use inner text<<<important or submit button and use innertext when ever possible. navigate("http://www.ubotstudio.com/resources", "Wait")wait for element(<innertext="Our Blog">, "", "Appear") or choose the last element that you need. I agree, i use that "wait for element" all the time.Can't go wrong with that one. Quote Link to post Share on other sites
LazyBotter 188 Posted September 24, 2013 Report Share Posted September 24, 2013 Yes, "Wait for element" with a timeout set, I find is best. :-) Quote Link to post Share on other sites
danoctav 7 Posted September 25, 2013 Report Share Posted September 25, 2013 "wait for element" is the the most precise,for sure.With this, is no need to guess the waiting time,just choose the last loading element ! Quote Link to post Share on other sites
Lucas 1 Posted September 25, 2013 Author Report Share Posted September 25, 2013 (edited) So damn glad I asked this question. I coded up my first script...I tested it in individual pieces which worked perfectly. I'm the boss I thought. I'm gonna rule the internet. But when I ran the nodes together the whole process (which formerly worked in pieces) broke repeatedly and I couldn't understand why. I used 'wait for browser event' still in a few places, and it was still breaking at different points for no clear reason. I didn't expect the type of waiting to be such a script breaking issue. Wait for element is what finally made the statements work as I expected. Waiting is a big deal. Edited September 25, 2013 by Lucas Quote Link to post Share on other sites
the_way 52 Posted September 27, 2013 Report Share Posted September 27, 2013 definitely wait for element, and then the actual element that your first then going to be dealing with is great, and usually i would put a 60 second time out. Straight after i normally put an IF to say that if the element doesn't exist then run the command again, until the element does exist. Quote Link to post Share on other sites
Lucas 1 Posted September 28, 2013 Author Report Share Posted September 28, 2013 definitely wait for element, and then the actual element that your first then going to be dealing with is great, and usually i would put a 60 second time out. Straight after i normally put an IF to say that if the element doesn't exist then run the command again, until the element does exist.Interesting. In my code I assume that if the element doesn't exist the website has changed in some way and I need to examine it manually. So after the wait for element (with just a 5 second time out) I have an IF which stops the script with an error if the element does not exist. I guess it depends on the site though... If it's a site I own and control then I might do it a bit like your way. I imagine you have a set number of iterations? Quote Link to post Share on other sites
Frank 177 Posted September 29, 2013 Report Share Posted September 29, 2013 With the boom in jquery on web sites, I don't even bother with anything other then the wait for element command. I'll normally select something on the page below where I'm automating and it works 100%. Why? Simple, javascript and jquery can dynamically change the page after it's totally loaded. I write jquery for some e-carts and I use this functionality to change the cart look and feel after the cart provider loads the page. Frank Quote Link to post Share on other sites
giganut 109 Posted September 29, 2013 Report Share Posted September 29, 2013 I use the wait for element command, it also keeps your bot on track when applied correctly. Make sure that the element you are waiting for is quinue to the page. I also use the wait for browser event, eveything loaded in some cases after navigating. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.