RandomLunatic Posted September 4, 2020 Share Posted September 4, 2020 Morning all. Some years ago I created a script that: Checked if a domain user needed to complete a survey If needed, presented them with a web based survey in a UI element Refused to close until they'd completed it Recorded that it was complete, so they only had to do it once. Management loved this, staff hated it. All was well until a couple of months ago it stopped working. You could no longer click on the buttons in the survey. No idea why. I've taken the script apart, can't find anything. You can replace the web based survey with a web page (say, BBC news) and you're golden. At the same time, an extra scroll bar appeared, which is just confusing. A cut down version of the script is presented below, without excess logic, but with a test survey to complete. All the problems are visible in this test. Issue applies to both Windows 7 and 10 hosts. Any ideas? I'm wondering if it's related to how the UI elements are handing scripting within websites, but....? Thanks in advance. expandcollapse popup#include <guiconstantsex.au3> #include <windowsconstants.au3> #include <IE.au3> Pulse() Func Pulse() Local $oIE, $GUIActiveX,$msg Local $surveylink Local $survey Local $fileflag Local $closeflag Local $checkfilepath $survey = -1 $closeflag = 0 $date = @YEAR & @MON & @MDAY if ($date > 20200609 and $date < 20201017) Then $survey = 1 $surveylink="https://www.surveymonkey.co.uk/r/DKQPWWM" ; Additional logic removed Else Exit EndIf ; Check if the user has completed a survey before ; Logic Removed $oIE = ObjCreate("Shell.explorer.2") ; Creates the form that is presented to the user GUICreate("Mandatory Punishment Survey", 1000, 580, -1,-1, 0x80000200) ; Creates the window that the web page is embedded within $GUIActiveX = GUICtrlCreateObj ($oIE, 10, 40, 975, 520) GUISetState();shows the Form $oIE.navigate($surveylink) $oIE.documentElement.scroll = "no" Sleep(10000) ; Loop until user finishes survey and uses the exist script or it is terminated While 1 ;After every loop check if the user clicked something in the GUI window $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE MsgBox(0,"","Please answer the question") Case $msg = $GUI_EVENT_MINIMIZE MsgBox(0,"","Please answer the question") Case $msg = $GUI_EVENT_RESIZED MsgBox(0,"","Please answer the question") case else $url = $oIE.document.url ;if Not ($url == $surveylink) Then if StringInStr($url,"survey",2,1) Then elseif StringInStr($url,"https://google.com",2,1) Then Else ; Logic removed controlling recording of completion Exit endif EndSelect WEnd EndFunc Link to comment Share on other sites More sharing options...
Danp2 Posted September 4, 2020 Share Posted September 4, 2020 This seems to be coming up a lot lately. Try adding the following to the beginning of your script -- #include <Process.au3> Local $regValue = "0x2AF8" ; IE11 edge mode: 11001 (0x2AF9) ; IE11: 11000 (0x2AF8) ; IE10: 10001 (0x2711) ; IE10: 10000 (0x02710) ; IE 9: 9999 (0x270F) ; IE 9: 9000 (0x2328) ; IE 8: 8888 (0x22B8) ; IE 8: 8000 (0x1F40) ; IE 7: 7000 (0x1B58) RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", _ProcessGetName(@AutoItPID), "REG_DWORD", $regValue) Code comes from here -- RandomLunatic 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
RandomLunatic Posted September 4, 2020 Author Share Posted September 4, 2020 That worked. Might be a permissions pain for the registry change... but the script itself works. The rest is just fiddling with details I understand 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