Jump to content

OliverTonn

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by OliverTonn

  1. Hello, it's me again. I'm still trying to control a web based visualization with AutoIt. I have put a small visualization on the internet, so anybody who finds the time could take a look and hopefully give me some advice how to control this visualization with AutoIt by directly addressing the controls and not via mouse move/click commands. The URL to this visualization is http://ist.tobit.net/Tc3PlcHmiWeb/Port_851/Visu/webvisu.htm The visualization contains different elements. The buttons switches the lamps below them on and off. The buttons should be pressed via AutoIt and it should be detected, if the LED lights up or not. The sliders are used to set a value which is displayed in a field behind the label "Value". At the moment I don't need to control sliders, but if anybody has an idea how to do it, it would be great if you tell me how. I have added the slider only to vary the displayed value. The field labeled Input is an input field in which a value from 0 to 255 could be entered. The choice of the radio button is also displayed below of it in the field labeled value. The last element is a drop down menu. The reason why the elements exists more then once is, because in TwinCAT 3 (The software with which this was created) allows to use subvisualizations which might act differently then if the elements are placed directly on the visualization.
  2. Thanks again, but there will be the same problem, I need it offline.
  3. OK, sorry, my fault. Its a "automaticly" generated webpage. It is created by the PLC development system TwinCAT 3 from Beckhoff and as far as if I'm correct it is a HTML 5 page only with Java script. It should be used to change certain states of a simulated machine, like door is open, smoke detector triggered, and so on.
  4. OK, thanks again. So if I'm right, I have to determine the xpath of each element I want to control and then use the data to control it. I took a look at ChroPath on an other system and I think I found the XPATH. My problem now is, that the system on which I must use it has no internet connection and till now I can't find the offline installer for ChroPath. I already sent the developer an emai.
  5. Hello community, I must admit it, I don't know what I'm doing. I'm writing a script which should control the following webpage: I would like to click on the marked object. By the way, how would be the best way to get the necessary data of certain objects to control them? Thanks in advance.
  6. OK, thanks, that did the trick.,
  7. I started to create a script, but when creating a session error messages occur. __WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData= __WD_Post: StatusCode=400; ResponseText={"value":{"error":"invalid argument","message":"invalid argument: missing command parameters","stack... __WD_Post ==> Invalid argument: {"value":{"error":"invalid argument","message":"invalid argument: missing command parameters","stacktrace":"Backtrace:\n\tOrdinal0 [0x00007FF6B81F5F92+4677522]\n\tOrdinal0 [0x00007FF6B7E9D577+1168759]\n\tOrdinal0 [0x00007FF6B7EED240+1495616]\n\tOrdinal0 [0x00007FF6B7E77F89+1015689]\n\tOrdinal0 [0x00007FF6B7F70EB1+2035377]\n\tOrdinal0 [0x00007FF6B7F3C72E+1820462]\n\tOrdinal0 [0x00007FF6B8113504+3749124]\n\tOrdinal0 [0x00007FF6B7F3D0FE+1822974]\n\tOrdinal0 [0x00007FF6B8208B54+4754260]\n\tOrdinal0 [0x00007FF6B7E77492+1012882]\n\tOrdinal0 [0x00007FF6B811DCA8+3792040]\n\tBaseThreadInitThunk [0x00007FF9E9697C24+20]\n\tRtlUserThreadStart [0x00007FF9EAECD721+33]\n"}} _WD_CreateSession: {"value":{"error":"invalid argument","message":"invalid argument: missing command parameters","stacktrace":"Backtrace:\n\tOrdinal0 [0x00007FF6B81F5F92+4677522]\n\tOrdinal0 [0x00007FF6B7E9D577+1168759]\n\tOrdinal0 [0x00007FF6B7EED240+1495616]\n\tOrdinal0 [0x00007FF6B7E77F89+1015689]\n\tOrdinal0 [0x00007FF6B7F70EB1+2035377]\n\tOrdinal0 [0x00007FF6B7F3C72E+1820462]\n\tOrdinal0 [0x00007FF6B8113504+3749124]\n\tOrdinal0 [0x00007FF6B7F3D0FE+1822974]\n\tOrdinal0 [0x00007FF6B8208B54+4754260]\n\tOrdinal0 [0x00007FF6B7E77492+1012882]\n\tOrdinal0 [0x00007FF6B811DCA8+3792040]\n\tBaseThreadInitThunk [0x00007FF9E9697C24+20]\n\tRtlUserThreadStart [0x00007FF9EAECD721+33]\n"}} _WD_CreateSession ==> Webdriver Exception: HTTP status = 400 Here is my code #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.5 Author: Oliver Tonn Script Function: Test PlasmaPQ #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include "wd_core.au3" #include "wd_helper.au3" #include <MsgBoxConstants.au3> #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> #include <WindowsConstants.au3> Main() Func Main() Local $sDesiredCapabilities, $sSession Local $nMsg ; List of tests Local $aTests[][2] = _ [["TMA", False], _ ["Door Alarms", True]] Local $iSpacing = 50 Local $iTestCnt = UBound($aTests) ; Determine number of tests Local $aTestChoice[$iTestCnt] Local $hGUI = GUICreate("PlasmaPQ Tests", 200, 150 + (20 * $iTestCnt), 100, 200, BitXOR($GUI_SS_DEFAULT_GUI, $WS_MINIMIZEBOX)) GUICtrlCreateLabel("Tests:", 15, 52) For $i = 0 To $iTestCnt - 1 $aTestChoice[$i] = GUICtrlCreateRadio($aTests[$i][0], 70, $iSpacing + (20 * $i), 100, 17, $GUI_SS_DEFAULT_RADIO) If $aTests[$i][1] Then GUICtrlSetState($aTestChoice[$i], $GUI_CHECKED) Next Local $iPos = $iSpacing + 20 * ($iTestCnt + 1) Local $idBtnStartTest = GUICtrlCreateButton("Run Test", 60, $iPos + 40, 85, 25) GUISetState(@SW_SHOW) While 1 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE ExitLoop 2 Case $idBtnStartTest SetupEdge() _WD_Startup() If @error <> $_WD_ERROR_Success Then Exit -1 EndIf $sSession = _WD_CreateSession($sDesiredCapabilities) If @error = $_WD_ERROR_Success Then _WD_Navigate($sSession, "http://www.is-tonn.de") ExitLoop Else _WD_Shutdown() Exit -1 EndIf EndSwitch WEnd $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE _WD_DeleteSession($sSession) _WD_Shutdown() ExitLoop EndSwitch WEnd GUIDelete($hGUI) EndFunc Func SetupEdge() _WD_Option('Driver', 'msedgedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\msedge.log"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"ms:edgeOptions": {"binary": "' & StringReplace(@ProgramFilesDir, "\", "/") & '/Microsoft/Edge/Application/msedge.exe", "excludeSwitches": [ "enable-automation"], "useAutomationExtension": false}}}}' EndFunc ;==>SetupEdge I took a brief search on google, but didn't find an answer.
  8. Hello Danp2, first of all thanks for creating the UDF. I am creating a PLC program which acts as a real machine so a PLC program on an other PLC for a real machine could be tested before the machine is build up. My simulation PLC program contains a web based visualization with which I control the simulation, e.g. "open a door", trigger a smoke detector. Now automated tests should be created and that's why I want to use AutiIt and your UDF, but how? Is there any documentation? First of all I think I must find all the controls (e.g. Buttons) in the visualization, so I can use them.
×
×
  • Create New...