Jump to content

stephan111

Members
  • Posts

    9
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

stephan111's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Works. Thank you very much. It's a pleasure to have a support like yours. Regards Stephan
  2. This code shows the same error: _WD_ExecuteScript($sSession, "return $.ajax({url:'http://hosting105782.a2f0c.netcup.net/test.php',type:'post',dataType: 'text', data:'getaccount=1',success : function(text){return text;}});")
  3. With this code the console window gets closed with version 0.3.0.3 but not with 0.3.0.4 and higher: #include <wd_core.au3> #include <wd_helper.au3> #include <GuiComboBoxEx.au3> #include <GUIConstantsEx.au3> Local $sSession, $sDesiredCapabilities SetupChrome() _WD_Startup() If @error <> $_WD_ERROR_Success Then Exit -1 EndIf $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Window($sSession, 'rect', '{"x":0,"y":0,"width":970,"height":800}') GUICreate("test", 300, 670, 975, 3) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") GUISetState(@SW_SHOW) Opt("GUIOnEventMode", 1) ;/ GUI erzeugen While 1 Sleep(100) WEnd Func SetupChrome() $browser = CheckBrowser('chrome') _WD_Option('Driver', 'driver\chromedriver-' & $browser[0] & '.exe') _WD_Option('Port', 9515) ;_WD_Option('DriverParams', '--verbose') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "excludeSwitches": ["enable-automation"], "useAutomationExtension": false, "prefs": {"credentials_enable_service": false} }}}}' EndFunc Func CheckBrowser($browser) ;https://www.autoitscript.com/forum/topic/191990-webdriver-udf-w3c-compliant-version-05252020/?do=findComment&comment=1443558 $sPath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\" & $browser & ".exe", "") ConsoleWrite("Path: " & $sPath & @CRLF) $aBrowserVersion = StringSplit(FileGetVersion($sPath), '.') Dim $return[2] $return[0] = $aBrowserVersion[1] $return[1] = StringReplace($sPath, '\', '\\') Return $return EndFunc Func _Exit() _WD_DeleteSession($sSession) _WD_Shutdown() Exit EndFunc ;==>_Exit
  4. Same here. Your second test generates an JS error. My problem is that the JS is correct but there is no answer to a ajax request. I think this is the difference.
  5. Since version 0.3.0.4 _WD_Shutdown does not close the console anymore. Changelog: Is there something that I have to do additionally to close the console? My shutdown sequence is _WD_DeleteSession($sSession) _WD_Shutdown() Regards Stephan
  6. _WD_ExecuteScript does not set the correct @error With this code: Local $accountBalanceNew = _WD_ExecuteScript($sSession, "return $.ajax({url:'/?getfile=account_logic',type:'post',dataType: 'text', data:'getaccount=1',success : function(text){return text;}});") ConsoleWrite(@error & @CRLF) ConsoleWrite($_WD_HTTPRESULT & @CRLF) I'm getting this answer if everything is ok: But it HTTP status is 500 @error is still '0' = $_WD_ERROR_Success Tried it with version 0.3.0.6 and 0.3.0.3 Regards Stephan
  7. @Danp2 Thank you for your fast response. I want to send a POST request in browser context because cookies are used. So WinHTTP is not possible. I could not find an example how to send a POST request via _WD_ functions. I can get the needed data with this js but I don't know how to get the value back to my script: $.post( '/?getfile=account_logic', { getaccount: '1'} ); I tested many things. This script works: _WD_ExecuteScript($sSession, "function getBalance() { var balance = window.location.href; return balance;} return getBalance();") But I don't know how to use $.post or $.ajax in the right way. Thanks
  8. Hello, is there a way to send POST requests via _WD_ functions? I also tried _WD_ExecuteStript but I couldn't get any value if I tried $.post. Any hints? Thanks in advance
×
×
  • Create New...