Genx Posted July 12, 2007 Share Posted July 12, 2007 Ah, what's the easiest way to check if a web viewer has loaded it's content? Link to comment Share on other sites More sharing options...
Vaughan Posted July 12, 2007 Share Posted July 12, 2007 This question came up somewhere else, must have been TechNet. Search for " Link to comment Share on other sites More sharing options...
JesseSFR Posted July 12, 2007 Share Posted July 12, 2007 You use this function GetLayoutObjectAttribute ( objectName ; attributeName {; repetitionNumber ; portalRowNumber} ) You're going to need to name your web viewer using the object info box. Once you name it, just pass in the name of your object and "content" as it's attribute and this function will return empty until the page is finished loading. Link to comment Share on other sites More sharing options...
Genx Posted July 12, 2007 Author Share Posted July 12, 2007 So content returns empty until the page is 100% finished loading? ... or I should do a PatternCount on content for the Link to comment Share on other sites More sharing options...
JesseSFR Posted July 12, 2007 Share Posted July 12, 2007 From what I have been told is that it's 100% empty until it's done. I believe that was from an FM technician too. I would test it anyway just to be certain. Maybe make a site that goes in a loop forever in php and never loads perhaps crash a server or two. Link to comment Share on other sites More sharing options...
Genx Posted July 12, 2007 Author Share Posted July 12, 2007 Lol love it, could always just make the php script sleep for a few seconds as well lol. Link to comment Share on other sites More sharing options...
aholtzapfel Posted July 12, 2007 Share Posted July 12, 2007 Problem with Searching for " Link to comment Share on other sites More sharing options...
Vaughan Posted July 13, 2007 Share Posted July 13, 2007 Even if you could check the web viewer's current state, in practice it'd be done the same way, ie with a loop. Only instead of checking for Link to comment Share on other sites More sharing options...
Genx Posted July 13, 2007 Author Share Posted July 13, 2007 E.g. this will probably work: Set Variable[ $timeout ; 60 ] Set Variable[ $startTime ; Get(currentTimeStamp) ] Loop Set Variable[ $content ; GetLayoutObjectAttribute( "webviewer" ; "content" ] Exit Loop If[Get(CurrentTime) > $startTime + $timeout or not IsEmpty($content)] End Loop Link to comment Share on other sites More sharing options...
aholtzapfel Posted July 13, 2007 Share Posted July 13, 2007 Problem Is you can't define what kind of error you have experianced. In some instances the webviewer will "stall" and fail to load the page. This can be fixed by reseting the webviewer in the script but if the site is down, it does no good. I have yet to be able to distinguish between errors on the web page, and DNS Errors. this is a problem. Without the abilty to define why the page failed to load it is hard to Gracfully handle the Error. I have been able to use the Webviewer with HUGE benifets (I used vbs scripts to scrape webpages previously), It is one of the best feature's that FM has added in a long time. That being said, the inability to check the status of a page is a pain. (In vbs scipts it was easy to check the status of the page and handle the errors gracefully.) In FM 9, I have heard there is now a status bar for the webviewer. Can any new info be obtained from this, within a script? Link to comment Share on other sites More sharing options...
Genx Posted July 17, 2007 Author Share Posted July 17, 2007 Im not sure about the status bar, I'll check in a few minutes... but: Why not just reset the web viewer and try a second time on the site if it does in fact time out? Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 6122 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now