andynewbie Posted January 29, 2007 Share Posted January 29, 2007 I am getting "REMOTE SCRIPTING ERROR: Page invoked does not support remote scripting".This sounds like the vendor made this app's web page so it cannot be automated.Does this mean I can't use AutoIT 3.0 for my project ?Andy#include <IE.au3>dim $oIE dim $s_modedim $returnstatus = 0dim $oIEdim $s_stringdim $oForm[10]dim $i_number_of_comparisonsdim $omyform;--------------------------------------------------------$oIE = _IECreate()_IENavigate($oIE, "http://miserdev/transactor");run('"C:\Program Files\Internet Explorer\iexplore.exe" http://miserdev/transactor');sleep(5000)$s_mode="Text"$oIE = _IEAttach ("Welcome to RMISER",$s_mode);MsgBox(0,"","status after attach:" & @error & " currwin=" & $oIE,5)$returnstatus = @error;--- run code in While loop as long as;the current window is not the one we wantwhile $returnstatus <> 0 ;msgbox(0,""," got wrong window",5) if $returnstatus = 7 then $oIE = _IEAttach ("Welcome to MISER",$s_mode) EndIf $returnstatus = @errorWend;------------------------; now we have the desired window active; press ENTER to click the Start button;------------------------Send("{ENTER}") ;----------- go to Login screen -------------------_IELoadWait ($oIE)if @error <> 0 Then msgbox(0,"","error in loadwait",5)Else msgbox(0,""," login is loaded",5)EndIf;$oForm = _IEFormGetCollection ($oIE, 0)$s_mode="Text"$s_string = "PIN"$oIE = _IEAttach ($s_string,$s_mode)$returnstatus = @error;--- run code in While loop as long as;the current window is not the one we want$i_number_of_comparisons = 0 msgbox(0,""," match string=" & $s_string & " mode=" & $s_mode,3)while $returnstatus <> 0 and $i_number_of_comparisons <= 5 if $returnstatus = 7 then $i_number_of_comparisons = $i_number_of_comparisons + 1 $oIE = _IEAttach ($s_string,$s_mode) EndIf $returnstatus = @errorWendif $i_number_of_comparisons > 5 Then msgbox (0,"","could not match to Login screen",5)EndIf Link to comment Share on other sites More sharing options...
someone Posted January 29, 2007 Share Posted January 29, 2007 I can't seem to manually browse to the URL... http://miserdev/transactor is that the correct address? Also you said you are using autoit 3.0. If you are using an old version of autoit I would recommend upgrading, as that too could solve your issue. While ProcessExists('Andrews bad day.exe') BlockInput(1) SoundPlay('Music.wav') SoundSetWaveVolume('Louder') WEnd Link to comment Share on other sites More sharing options...
andynewbie Posted January 29, 2007 Author Share Posted January 29, 2007 I can't seem to manually browse to the URL... http://miserdev/transactor is that the correct address? Also you said you are using autoit 3.0. If you are using an old version of autoit I would recommend upgrading, as that too could solve your issue.Correct. That web page is on our Intranet, so you won't be able to browse to it.I am using AutoIT 3.2.2.0 and the latest beta to use the _IE commands. Link to comment Share on other sites More sharing options...
someone Posted January 29, 2007 Share Posted January 29, 2007 Probably should have caught that about it being on an intranet..... anyway, its a little hard to tell since I can't duplicate the error, but my advice would be to see if any IE.au3 functions fail on this site; to chop up your script and see if any part of it works/doesn't work. Does the message box pop up immediately or when your script does a particular thing? Try adding TrayIconDebug to your script and see if when the error message comes up you can see what your script is doing. Can you attach a screenshot of the error? Hmm... I'll keep thinking about this one but try to make a very simply script to interact with your webpage - the simpler the better. If that works, make it more complex until it doesn't work on the page, and post what failed. Sorry I couldn't be of more help. PS. I don't know if this has anything to do with why your script is failing, but your script could use some tidying up. $oIE = _IECreate() _IENavigate($oIE, "http://miserdev/transactor") $oIE = _IEAttach ("Welcome to RMISER",$s_mode) doesn't really make sense, as you could just use $oIE = _IECreate("http://miserdev/transactor") instead of iecreate, navigate, then attach. Or am I missing something? While ProcessExists('Andrews bad day.exe') BlockInput(1) SoundPlay('Music.wav') SoundSetWaveVolume('Louder') WEnd Link to comment Share on other sites More sharing options...
andynewbie Posted January 29, 2007 Author Share Posted January 29, 2007 Probably should have caught that about it being on an intranet..... anyway, its a little hard to tell since I can't duplicate the error, but my advice would be to see if any IE.au3 functions fail on this site; to chop up your script and see if any part of it works/doesn't work. Does the message box pop up immediately or when your script does a particular thing? Try adding TrayIconDebug to your script and see if when the error message comes up you can see what your script is doing.Can you attach a screenshot of the error?Hmm... I'll keep thinking about this one but try to make a very simply script to interact with your webpage - the simpler the better. If that works, make it more complex until it doesn't work on the page, and post what failed. Sorry I couldn't be of more help.PS. I don't know if this has anything to do with why your script is failing, but your script could use some tidying up.$oIE = _IECreate()_IENavigate($oIE, "http://miserdev/transactor")$oIE = _IEAttach ("Welcome to RMISER",$s_mode)doesn't really make sense, as you could just use $oIE = _IECreate("http://miserdev/transactor") instead of iecreate, navigate, then attach. Or am I missing something?I've attached the first two pages of this app, and a printscreen of the REMOTE... error. Link to comment Share on other sites More sharing options...
seandisanti Posted January 29, 2007 Share Posted January 29, 2007 I've attached the first two pages of this app, and a printscreen of the REMOTE... error.are you able to post the source to the web page? Link to comment Share on other sites More sharing options...
seandisanti Posted January 29, 2007 Share Posted January 29, 2007 are you able to post the source to the web page?Also, at what point in your code are you receiving the error? Does the _IEAttach() successfully grab the new window? Link to comment Share on other sites More sharing options...
andynewbie Posted January 29, 2007 Author Share Posted January 29, 2007 Also, at what point in your code are you receiving the error? Does the _IEAttach() successfully grab the new window? 1) My script is only clicking through existing web pages and popups, entering text, etc. It does NOT create a web page, it only references them. The script times response time, bcse. mgmt wants some hard numbers to tell people that complain about the new "slow" system. 2) No, my 2nd send _IEAttach is not finding the 2nd web page. Very puzzling. It returns a 7, meaning 'no match'. I've tried changing the text to something else that is on the existing page, but that didn't work either. 3) The FormGetCollection is there because the AutoIT utility doesn't list a form name. It also returns a 7. I tried to put it into an array of objects, like Help says to do, but I kept getting syntax errors. The algorithm is like this: Start the app Confirm the first page is what displays first, clicking through any unexpected popups first, then click Start on the first page. Wait until the next page displays, clicking through any popups, then enter data into the next page. Continue until we get to the page we can to run Timer to put stats into the log file. ---------------------------------------------- #include <IE.au3> ;AutoItSetOption ("WinTitleMatchMode", 4) dim $oIE dim $s_mode dim $returnstatus = 0 dim $oIE dim $s_string dim $oForm dim $i_number_of_comparisons dim $omyform dim $oURL dim $founderrors = 0 dim $logfilenametoday dim $timestamp dim $logfile ;-------------------------------------------------------- $logfilenametoday = @YEAR & "_" & @MON & "_" & @MDAY & ".log" $timestamp = @YEAR & "/" & @MON & "/" & @MDAY & "_" & @HOUR & ":" & @min & ":" & @SEC ;----------------------------- ; open log FileChangeDir ;----------------------------- $logfile = FileOpen("C:\Documents and Settings\baperfuser\My Documents\andysfiles\timeroutput\BA_PERF_DATA_" & $logfilenametoday, 1) FileWriteLine($logfile, "timestamp:" & $timestamp & ". Start this AutoIT script at $logfilenametoday)") FileWriteLine($logfile, "timestamp:" & $timestamp & ". Start time: " & $timestamp) ;--------------------------------------------------------------- $oURL = "http://miserdev/transactor" $oIE = _IECreate($oURL) ;if $founderrors = 1 Then ;EndIf ;_IENavigate($oIE, $oURL) ;run('"C:\Program Files\Internet Explorer\iexplore.exe" http://miserdev/transactor') ;sleep(5000) $s_mode="Text" $oIE = _IEAttach ("Welcome to MISER",$s_mode) ;MsgBox(0,"","status after attach:" & @error & " currwin=" & $oIE,5) $returnstatus = @error ;--- run code in While loop as long as ;the current window is not the one we want while $returnstatus <> 0 ;msgbox(0,""," got wrong window",5) if $returnstatus = 7 then MsgBox(0,"","start page not found",5) SEND("{ENTER}") SLEEp (5000) $oIE = _IEAttach ("Welcome to MISER",$s_mode) EndIf $returnstatus = @error Wend ;------------------------ ; now we have the desired window active ; press ENTER to click the Start button ;------------------------ ; JUMP TO THE 2ND SCREEN ;------------------------- Send("{ENTER}") ;msgbox(0,"","extended="& @extended,5) $oForm = _IEFormGetObjByName ($oIE, "Internet Explorer_Server1") ;$oForm = _IEFormGetCollection ($oIE,-1) MsgBox(0,"","erro after getcollection=" & @error,5) ;msgbox(0,"","form 2:" & $oForm[2],5) ;msgbox(0,"","form 3:" & $oForm[3],5) ;----------- go to Login screen ------------------- ;sleep(5000) _IELoadWait ($oIE) if @error <> 0 Then msgbox(0,"","error in loadwait",5) Else msgbox(0,""," login is loaded",5) EndIf ;$oForm = _IEFormGetCollection ($oIE, 0) ;$omyform = $oForm[0] ;msgbox(0,"","oform : " & $oForm[0],5) $s_mode="text" $s_string = "Sign On" ; $oForm = _IEFormGetCollection ($oIE, 0) $oIE = _IEAttach ($s_string,$s_mode) MsgBox(0,"","status after login attach:" & @error,5) $returnstatus = @error ;--- run code in While loop as long as ;the current window is not the one we want $i_number_of_comparisons = 0 ;msgbox(0,""," match string=" & $s_string & " mode=" & $s_mode,3) while $returnstatus <> 0 and $i_number_of_comparisons <= 5 if $returnstatus = 7 then $i_number_of_comparisons = $i_number_of_comparisons + 1 $oIE = _IEAttach ($s_string,$s_mode) elseif $returnstatus = 5 Then msgbox(0,""," invalid value. bail out !",5) $founderrors = 1 EndIf $returnstatus = @error Wend if $i_number_of_comparisons > 5 Then msgbox (0,"","could not match to Login screen. Exiting application.",5) $founderrors = 1 EndIf ------------------------------------------ THE END---------------- Link to comment Share on other sites More sharing options...
someone Posted January 30, 2007 Share Posted January 30, 2007 Its hard to tell without being able to recreate the error, but I guess I still recommend trying to take it step by step to try to identify the problem. Is it possible this is a work computer that has a program installed to block simulated keystrokes such as the Send command? If you comment out the send command and press enter yourself does the script fail? Really most of my ideas are based on that... does any script work with that program? Does any of this script work? Also at the top of your script why do you have _IECreate and then _IEAttach? When you browse to the URL does it 'pop' up a 2nd window? What do you mean when you say "Confirm the first page is what displays first"? Sorry to kill you with questions. Let us know how it goes, and good luck. Andrew While ProcessExists('Andrews bad day.exe') BlockInput(1) SoundPlay('Music.wav') SoundSetWaveVolume('Louder') WEnd 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