Kamakazy Posted November 26, 2012 Share Posted November 26, 2012 Hi All. I am baffled by n piece of scripting.... The background is: I am Automating an internal website in IE. Everything was going great up to the point where I needed to start and refactor some code. The way the system is designed is that options are selected but all interactions (warnings, errors, results,etc) are generated by JS. The previous way I dealt with this was to simply add "Sleep(5000)" in every now and then. But in my experiance, this is a dangerous way as not all returns take the same time. Is there a way that I can get the script to wait for the process to respond (_IELoadWait is not working) before continueing.. PS. I have also tried reading the body HTML and asserting if certain text is present but this also failed as none of the JS is visible in the HTML of the source... I'm stummped on this one. If you need any other info, ill gladly give it. Thanx guys. Kama _IEFrameGetObjByID | Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 26, 2012 Moderators Share Posted November 26, 2012 Assuming you know what you're talking about since this is internal, btw, Having internal html/JS you are miles above the others, something like the below should be simple for you. Why not just use something like ...parentWindow().execScript or ...parentWindow().eval() to accomplish what you want? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Kamakazy Posted November 26, 2012 Author Share Posted November 26, 2012 Mmmm, Have not thought about that.... My mind was stuck in IE. Will give it a whirl.. Thanx man ! _IEFrameGetObjByID | Link to comment Share on other sites More sharing options...
Kamakazy Posted November 26, 2012 Author Share Posted November 26, 2012 (edited) Update:The trick did not work but I have found a small workaround.Instead of trying to assert if something exists, I rather looked for something that does NOT exist. this little error check did the trick in bypassing the JS error.CODE: $oIE already declared $oForm already declared $oFormField = _IEFormElementGetObjByName($0Form, "Field to be tested") _IEFormElementSetValue($oFormField, "value/###") If _IEFormElementGetValue ($oFormField) = "" Then ; At this point I am checking the field to see if it has data or not _FileWriteLog($log, "Your error Msg ") ; If no data was detected in the field, I log it and stop the script from procedding. Exit 0 Else _FileWriteLog($log, "Your success Msg") ; If data was found, I also log it and simply continue on. EndIfNote, for security reasons, all variables and values have been changed....Hope this works for you!And critics are welcome, good or bad.... thats how I learn.Kama Edited November 26, 2012 by Kamakazy _IEFrameGetObjByID | Link to comment Share on other sites More sharing options...
Recommended Posts
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