3mustgetbeers Posted June 16, 2012 Share Posted June 16, 2012 (edited) Good evening/afternoon/morning to all you lovely people where ever you may be! I'm writing a script for use at work, this is a small part of it which isn't functioning correctly. It is used to search a network monitoring system (Solar Winds). The user gets a gui, enters a search string, selects one of two radio buttons (to determine if its node name or ip address) then clicks ok. The results are concatenated with the rest of the url then passed to IE for the NMS web interface. expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <IE.au3> $SolarWinds_SEARCH_Gui = GUICreate("", 148, 166, 189, 124) $SolarWinds_SEARCH_Title = GUICtrlCreateLabel("Solarwinds Search", 24, 16, 92, 17) $SolarWinds_SEARCH_Input = GUICtrlCreateInput("", 16, 40, 113, 21) $SolarWinds_SEARCH_NNrad = GUICtrlCreateRadio("Node Name", 32, 72, 81, 17) $SolarWinds_SEARCH_IPrad = GUICtrlCreateRadio("IP Address", 32, 96, 81, 17) $SolarWinds_SEARCH_Btn_OK = GUICtrlCreateButton("OK", 16, 128, 51, 25) $SolarWinds_SEARCH_Btn_Cancel = GUICtrlCreateButton("Cancel", 80, 128, 51, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($SolarWinds_SEARCH_Gui) Case $SolarWinds_SEARCH_Btn_Cancel GUIDelete($SolarWinds_SEARCH_Gui) Case $SolarWinds_SEARCH_Btn_OK $SolarWinds_SEARCH_NodeString = "http://server:port/Orion/NetPerfMon/Resources/NodeSearchResults.aspx?Property=Caption&SearchText=" $SolarWinds_SEARCH_IPString = "http://server:port/Orion/NetPerfMon/Resources/NodeSearchResults.aspx?Property=IP_Address&SearchText=" $SolarWinds_SEARCH_UsrInpt = GUICtrlRead($SolarWinds_SEARCH_Input) $oIE = _IECreate("www.google.com") If GUICtrlRead($SolarWinds_SEARCH_NNrad) = $GUI_CHECKED Then GUIDelete($SolarWinds_SEARCH_Gui) _IENavigate($oIE, $SolarWinds_SEARCH_NodeString & $SolarWinds_SEARCH_UsrInpt, 1) ElseIf GUICtrlRead($SolarWinds_SEARCH_IPrad) = $GUI_CHECKED Then GUIDelete($SolarWinds_SEARCH_Gui) _IENavigate($oIE, $SolarWinds_SEARCH_IPString & $SolarWinds_SEARCH_UsrInpt, 1) Else MsgBox(4096, "Error!", "Please select either Node Name or IP") EndIf EndSwitch WEnd The problem is, it only works sometimes - about 60% Every time the correct url is passed to IE (see pic1.jpg ) however about 40% of the time part of the url is dropped (see pic2.jpg ) I initially wrote the script using _IECreate, the above I modified to use _IENavigate - there doesn't seem to be a difference. Given that the correct url is passed to ie I don't think this is an AutoIT issue (can anyone confirm?). What I don't understand is that IE appears to start loading the url, but then drops everything after (and including) the ampersand? It isn't even as though it is navigating to one of the variables - the ampersand is part of the first variable?? Why would this happen? Any suggestions for overcoming it? Thanks in advance for any replies Edited June 18, 2012 by 3mustgetbeers Link to comment Share on other sites More sharing options...
3mustgetbeers Posted June 17, 2012 Author Share Posted June 17, 2012 OK, I have tried the ShellExecute method which proves just as unreliable. Alternative browser isn't an option so I haven't even explored this avenue. I'm running XP SP3 with IE8, rolled back to 7 & it works even less frequently. Anybody any ideas at all other than opening IE and using control send to the address bar? Cheers Link to comment Share on other sites More sharing options...
3mustgetbeers Posted June 18, 2012 Author Share Posted June 18, 2012 (edited) Ok, this definitely appears to be a fault with IE (or our web GUI?) – quite strange behaviour. The simplest of tests has now proved this – I opened IE & pasted into the address bar the url: "http://server:port/Orion/NetPerfMon/Resources/NodeSearchResults.aspx?Property=IP_Address&SearchText=1.2.3.4". The bottom of IE shows that it is waiting on this address. However when the page loads the url has been changed to “http://server:port/Orion/NetPerfMon/Resources/NodeSearchResults.aspx?Property=IP_Address”I have absolutely no idea why this would be at this stage – I can see the correct URL after pasting, it doesn’t load a page then redirect; so at the minute I’m a bit stuck. However, I can say that this is nothing what so ever to do with AutoIT! I guess that at least narrows down the search! I suppose testing with another browser is now the next logical step – if it happens in Firefox then its something on our box (please no!! haha!)Mods, I guess this can now be closed/resolved - not sure if I can do this myself?? Edited June 18, 2012 by 3mustgetbeers Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 18, 2012 Moderators Share Posted June 18, 2012 3mustgetbeers,Edit the first post and select the "Use Full Editor" option - then you can edit the title. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
3mustgetbeers Posted June 18, 2012 Author Share Posted June 18, 2012 Cheers Melba 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