Jump to content

Drac89

Active Members
  • Posts

    25
  • Joined

  • Last visited

Everything posted by Drac89

  1. Hello I am trying to use the Runas function to launch the sql management studio application using another domain user profile other than the one logged into. Its a domain user, i tried with nologon profile and logon profile.Its not working. I tried with #requireAdmin as well. The windows runas command works and also if we do run as different user, it works. The error flag just gives a 1 and the PID is always 0. Any idea? Should the user have pre logged into the machine and have a profile under users? I can't seem to find the user SID under the profilelist registry as well. Hence tried with nologon profile.
  2. Ohhh didn't know this.. Thank you so much for responding.. Will test this out and look further on these..
  3. oh sorry, this is beyondtrust appliance , that we do operational task on, so its just https://<IP> , The below is what is seen in the login button <bt-button mutable-label="standard.translations.Login" class="login ng-isolate-scope disabled" type="filled" enter-key="standard.submit()" ng-click="standard.submit()" progress-bar="standard.service().standardProgressBarState" is-disabled="(!standard.username || !standard.password)" tabindex="-1"><!-- ngIf: button.progressBar != undefined --><div ng-if="button.progressBar != undefined" class="progress-bg ng-scope ng-hide" ng-show="button.progress.show" style="margin-top:-4px;"> and sending with send() works now but need to work with _IEFormElementSetValue. attached is the username field details seen.
  4. Hi @Danp2 i had used _IEFormElementSetValue($email_field, $username) _IEFormElementSetValue($pass_field, $password) and it is passing as well, but the login button, doesnt become active, even though the input is already sent for the login fields.
  5. Hi Team, I am trying to send credentials via autoit on a web app launched via IE. I am passing the credentials into variables and trying to send them send("$username") but username field isn't getting populated. But the password field, I can send the credential, also when I try ieformsetvalue and set the username wrt username field fetched, it's getting send but my login button remains greyed out. Can angularjs keydown function interfere in the autoit send process and not allow the credentials passed if it's not typed out? This is a general question to understand if javascript or angular js etc could detect if the credentials are automated, then it might not detect it as a keydown?
  6. Hi i got the workaround for the issue i was facing but is there a way to hide the command prompt that is launched for chromedriver ?
  7. @Danp2thanks a lot for your help
  8. oh that error doesnt come up now, i had updated the above log,I think there was an instance of chrome already running in the user profile, is there a way to hide the cli prompts that opens up ? and also it says "chrome is being controlled by automated test software" , is it possible to hide that ? I created the below simple script now, #include "wd_core.au3" #include "wd_helper.au3" Local $sDesiredCapabilities, $sSession google() Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["user-data-dir=userData", "--no-sandbox"]}}}}' EndFunc ;==>SetupChrome ;Func _ChromeSetInputValueById($sSession,$Id,$Value) ;$sButton = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@id='"&$Id&"']") ;_WD_ElementAction($sSession,$sButton,'value', $Value) ;EndFunc Func google() SetupChrome() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://172.16.22.224:8443/") _WD_Shutdown() EndFunc So the above launches but the navigation to the url takes some time , while waiting for it to navigate, in console, it is at __WD_Post: URL=HTTP://127.0.0.1:9515/session/ff347ff8afa85aee5fee7211b5596176/url; $sData={"url":"https://172.16.22.224:8443/"} i believe the response for the above is taking time. For this, i was just testing the launch of the application and navigation to url.and have commented the passing of credentials etc. In logs now, it doesn't show error. >"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\divya\Desktop\chrome_autoti\WebDriver-0.3.0.4\WebDriver-0.3.0.4\wd_do1.au3" _WD_IsLatestRelease: _WD_IsLatestRelease ==> Send / Recv error _WDStartup: OS: WIN_2016 WIN32_NT 14393 _WDStartup: AutoIt: 3.3.14.5 _WDStartup: WD.au3: 0.3.0.4 (Update status unknown [6]) _WDStartup: WinHTTP: 1.6.4.2 _WDStartup: Driver: chromedriver.exe _WDStartup: Params: --log-path="C:\Users\divya\Desktop\chrome_autoti\WebDriver-0.3.0.4\WebDriver-0.3.0.4\chrome.log" _WDStartup: Port: 9515 __WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["user-data-dir=userData", "--no-sandbox"]}}}} __WD_Post: StatusCode=200; ResponseText={"value":{"capabilities":{"acceptInsecureCerts":false,"browserName":"chrome","browserVersion":"84.0.... _WD_CreateSession: {"value":{"capabilities":{"acceptInsecureCerts":false,"browserName":"chrome","browserVersion":"84.0.4147.89","chrome":{"chromedriverVersion":"84.0.4147.30 (48b3e868b4cc0aa7e8149519690b6f6949e110a8-refs/branch-heads/4147@{#310})","userDataDir":"userData"},"goog:chromeOptions":{"debuggerAddress":"localhost:61568"},"networkConnectionEnabled":false,"pageLoadStrategy":"normal","platformName":"windows","proxy":{},"setWindowRect":true,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unhandledPromptBehavior":"dismiss and notify","webauthn:virtualAuthenticators":true},"sessionId":"ff347ff8afa85aee5fee7211b5596176"}} __WD_Post: URL=HTTP://127.0.0.1:9515/session/ff347ff8afa85aee5fee7211b5596176/url; $sData={"url":"https://172.16.22.224:8443/"} __WD_Post: StatusCode=200; ResponseText={"value":null}... _WD_Navigate: {"value":null} >Exit code: 0 Time: 26.5
  9. So on the cli, this error comes up, whenWD_navigate shows up in the console
  10. Hi @Danp2 Thank you...adding that, did launch the chrome browser but the navigation is taking a long time, in console , it gives timeout but then again a prompt comes and then takes time >"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\divya\Desktop\chrome_autoti\WebDriver-0.3.0.4\WebDriver-0.3.0.4\wd_demo.au3" _WD_IsLatestRelease: _WD_IsLatestRelease ==> Send / Recv error _WDStartup: OS: WIN_2016 WIN32_NT 14393 _WDStartup: AutoIt: 3.3.14.5 _WDStartup: WD.au3: 0.3.0.4 (Update status unknown [6]) _WDStartup: WinHTTP: 1.6.4.2 _WDStartup: Driver: chromedriver.exe _WDStartup: Params: --log-path="C:\Users\divya\Desktop\chrome_autoti\WebDriver-0.3.0.4\WebDriver-0.3.0.4\chrome.log" _WDStartup: Port: 9515 __WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["user-data-dir=userData", "--no-sandbox"]}}}} __WD_Post: StatusCode=200; ResponseText={"value":{"capabilities":{"acceptInsecureCerts":false,"browserName":"chrome","browserVersion":"84.0.... _WD_CreateSession: {"value":{"capabilities":{"acceptInsecureCerts":false,"browserName":"chrome","browserVersion":"84.0.4147.89","chrome":{"chromedriverVersion":"84.0.4147.30 (48b3e868b4cc0aa7e8149519690b6f6949e110a8-refs/branch-heads/4147@{#310})","userDataDir":"userData"},"goog:chromeOptions":{"debuggerAddress":"localhost:61238"},"networkConnectionEnabled":false,"pageLoadStrategy":"normal","platformName":"windows","proxy":{},"setWindowRect":true,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unhandledPromptBehavior":"dismiss and notify","webauthn:virtualAuthenticators":true},"sessionId":"318fca339b594c62c92f3c5339f30d23"}} Bypass: DemoTimeouts +Running: DemoNavigation __WD_Post: URL=HTTP://127.0.0.1:9515/session/318fca339b594c62c92f3c5339f30d23/url; $sData={"url":"http://google.com"} __WD_Post: StatusCode=0; ResponseText=WinHTTP request timed out before Webdriver... __WD_Post ==> Send / Recv error: WinHTTP request timed out before Webdriver _WD_Navigate: WinHTTP request timed out before Webdriver _WD_Navigate ==> Send / Recv error: HTTP status = 0 __WD_Get: URL=HTTP://127.0.0.1:9515/session/318fca339b594c62c92f3c5339f30d23/window/handles Also, i read through the wiki , the winhttp constant au3 , i didnt add that initially, so had done that as well. is there a way to hide the cli prompts that opens up ? and also it says "chrome is being controlled by automated test software" , is it possible to hide that ?
  11. thank you for testing it in your environment,Mine is also a win2016 vm server. I didnt try the sandbox option, wasnt sure how to use it. should i use it along with the below ? $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"chromeOptions": {"w3c": true, "args":["user-data-dir=userData"] } }}}' ??
  12. Hi @Danp2 The error i am getting in console _WD_IsLatestRelease: _WD_IsLatestRelease ==> Send / Recv error _WDStartup: OS: WIN_2016 WIN32_NT 14393 _WDStartup: AutoIt: 3.3.14.5 _WDStartup: WD.au3: 0.3.0.4 (Update status unknown [6]) _WDStartup: WinHTTP: 1.6.4.2 _WDStartup: Driver: chromedriver.exe _WDStartup: Params: --log-path="C:\Users\divya\Desktop\chrome_autoti\WebDriver-0.3.0.4\WebDriver-0.3.0.4\chrome.log" _WDStartup: Port: 9515 __WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true }}}} __WD_Post: StatusCode=500; ResponseText={"value":{"error":"unknown error","message":"unknown error: unable to discover open window in chrome... _WD_CreateSession: {"value":{"error":"unknown error","message":"unknown error: unable to discover open window in chrome\n (Session info: chrome=84.0.4147.89)","stacktrace":"Backtrace:\n\tOrdinal0 [0x011B87E3+2852835]\n\tOrdinal0 [0x010A5BB1+1727409]\n\tOrdinal0 [0x00F7E4B9+517305]\n\tOrdinal0 [0x00F6F0E7+454887]\n\tOrdinal0 [0x00F2DB06+187142]\n\tOrdinal0 [0x00F2D7FD+186365]\n\tOrdinal0 [0x00F2B70B+177931]\n\tOrdinal0 [0x00F12584+75140]\n\tOrdinal0 [0x00F13650+79440]\n\tOrdinal0 [0x00F135E9+79337]\n\tOrdinal0 [0x010BAD5C+1813852]\n\tGetHandleVerifier [0x012DC616+1075574]\n\tGetHandleVerifier [0x012DC367+1074887]\n\tGetHandleVerifier [0x012E7497+1120247]\n\tGetHandleVerifier [0x012DCC16+1077110]\n\tOrdinal0 [0x010B3206+1782278]\n\tOrdinal0 [0x010BC3BB+1819579]\n\tOrdinal0 [0x010BC523+1819939]\n\tOrdinal0 [0x010D2B45+1911621]\n\tBaseThreadInitThunk [0x746162C4+36]\n\tRtlSubscribeWnfStateChangeNotification [0x77930FD9+1081]\n\tRtlSubscribeWnfStateChangeNotification [0x77930FA4+1028]\n"}} _WD_CreateSession ==> Webdriver Exception: unknown error: unable to discover open window in chrome (Session info: chrome=84.0.4147.89) __WD_Delete: URL=HTTP://127.0.0.1:9515/session/ __WD_Delete: StatusCode=200; ResponseText={"value":null}... _WD_DeleteSession: {"value":null} I did download the latest winHTTP from the wiki https://raw.githubusercontent.com/dragana-r/autoit-winhttp/master/WinHttp.au3 the chromedriver version is 84.0.4147.30 and chrome browser version is 84.0.4147.89.I am trying it from windows server 2016 ...could that be the issue ? attaching the chrome log. chrome.log
  13. Hi I am trying to use the UDF under and i was just testing with wd_demo script but on trying the demo navigation, the chrome browser launches but it then crashes without navigating and gives popup saying "chrome automation extension crashed".the chrome driver was started and was listening on the port as well and in the console, it gave GPU crashed error. I was about to post and ask under the webdriver UDF support group but it mentions that the thread is closed and so i have posted here.Anyone have faced the same issue ?
  14. I am trying to do User login automation of web app which launches via IE and runs a Java application called oracle fusion Middleware. The login prompt is within IE, after the Java applet loads. So I have used winwaitactive and tried to passed the credentials when the title name matches. It does nt match, because the IE handle is still active and the applet isn't active. But when I use a msgbox within the if statement of winwaitactive, then it passes the credentials. I tried using iecreate with no iewait set and the focus parameter set to 0 and still the title didn't match when used wo msgbox.
  15. Hi There is no syntax error I get. And the error detail is there in the title of this thread
  16. #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile=ps_test.exe #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <Constants.au3> #include <IE_v1.au3> Func get_credentials($token) Local $aResult = DLLCall("pbpspassthru.dll", "str:cdecl", "pbps_get_credentials", "str", $token, "bool", 0) Local $credentials = StringSplit($aResult[0], " ") return $credentials Endfunc If $CmdLine[0] < 1 Then MsgBox($MB_OK, "Usage", "ps_Cisco_ISE<passthru_token>") Else Cisco_ISE($CmdLine[1]) EndIf ;If $CmdLine[0] < 2 Then ;MsgBox($MB_OK, "Usage", "ps_Cisco_ISE <username> <password>") ;Else ;Cisco_ISE($CmdLine[1], $CmdLine[2]) ;EndIf Func Cisco_ISE($token) ;Func Cisco_ISE($email, $password) Local $credentials = get_credentials($token) Local $email = $credentials[1] Local $password = $credentials[2] Local $ie = _IECreate("https:///<IPdetails>, 1) Local $oIE = _IEAttach("Cert") _IELinkClickByText($oIE, "Continue to this website (not recommended).") If @error > 0 Then Local $i = 0 Do Sleep(500) $i = $i + 1 $ie = _IEAttach("<IPdetails>") Until VarGetType($ie) == "Object" Or $i >= 10 EndIf If VarGetType($ie) == "Object" Then $hwnd = _IEPropertyGet($ie, "hwnd") WinSetState($hwnd, "", @SW_MAXIMIZE) ; Send the Username Send($email, 1) ; Ensure we are in the Password field Sleep(100) ; Send the Password Send("{TAB}") Send($password, 1) Sleep(10) ; Submit the credentials Send("{TAB}") Sleep(500) Send("{SPACE}") Send("{SPACE}") Send("{TAB}") Send("{ENTER}") WinWaitClose($hwnd) Else MsgBox($MB_OK, "Login Failure", "Password Safe failed to automate the login. If this problem persists please contact your Password Safe Administrator.") EndIf EndFunc ;==>Cisco_ISE()
  17. Hi Nine Below is the screenshot :- I tried with the text inside the confirm Exit window as well but it doesnt seem to work. Should i put the title in a variable and then use that variable in Winexists ? Thank you for taking the time.
  18. The thing is I need to send the username and password only if it detects another window and that window if prompted, I check the username that's in it and if the username matches with what's being passed, then I pass credential and it logs in. And if username is nt same, then it gives out a message. And whenever the user choose the sap Hana tenant, it should do the above and once confirm exit window is seen, it has to get out of the loop. And I am nt able to detect that window at all, I dno how to make it detect.
  19. no it isnt working still...it isnt detecting the window Handle .This is the window and i used the autoitinfo tool and it is detecting but still in the loop , its nt working. I want to exit the loop when the application stops running.I tried processexist in the do until condition and nothing, it is still not exiting.Can anyone please help. It is SAP hana studio client.
  20. Oh okay, so I do the if cmp =0 and the else not allowed to access- a separate if else. Then a separate' if 'for win exists? So the' if win exists' should return a true value if the window exists right? It can be used in a if statement. Okay ll test n see
  21. How do i exit from a while loop when a window exists ? I tried do until Winexist("Confirm Exit") but still it isnt exiting. I tried below as well but it isnt working. Can anyone please help ? #include <Constants.au3> #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> If $CmdLine[0] <> 2 Then    MsgBox($MB_OK, "Usage", "saphana <username> <password>") Else    saphana($CmdLine[1], $CmdLine[2]) EndIf Global $sData Func saphana($username, $password) Global $spid = Run("C:\Program Files\sap\hdbstudio\hdbstudio.exe") MsgBox($MB_OK, "Usage", "script"&$spid,2,"") Global $flag = 1 Global $PID = WinWait("hdbstudio - SAP HANA Administration Console - SAP HANA Studio") Local $lpid = ProcessExists($spid) MsgBox($MB_OK, "Usage", "script2"&$lpid,2,"") While $flag = 1  MsgBox($MB_OK, "Usage", "script3"&$PID,2,"") $hwnd = WinWait("Database User Logon -")    ; Ensure we are in the Username fieldm    ; Send the instance ControlFocus($hWnd, "", "Edit1") ControlClick($hWnd, "", "Edit1", "left", 2,"","") Send("^c") ;Copy selected text. $sData = ClipGet() ;Retrieves text from clipboard. $PID = WinWait("hdbstudio - SAP HANA Administration Console - SAP HANA Studio") Local $cmp= StringCompare($sData,$username)  If $cmp = 0 Then     Send("{TAB}")    ; Ensure we are in the Password field    ; Send the Password    Send($password, 1)    ; Submit the credentials    Send("{ENTER}") ElseIf WinExists ("Confirm Exit") Then    ExitLoop Else    MsgBox($MB_OK, "Usage", "Not allowed to access",2,"")    WinWaitClose($hwnd) EndIf WEnd WinWaitClose($hwnd) EndFunc ;==>saphana()
  22. How do i pass the IE handle to an active windows authentication prompt when the IE shows it is " waiting " , right now it is nt detecting the windows security prompt I used the below to wait for it to load until the 60ms timeout but still it isnt working : #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile=ps_test.exe #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <Constants.au3> #include <IE_v1.au3> If $CmdLine[0] < 2 Then MsgBox($MB_OK, "Usage", "ps_WAN <username> <password>") Else wan($CmdLine[1], $CmdLine[2]) EndIf Func wan($email, $password) $oIE = _IECreate() $ieo=_IENavigate($oIE, "https://cccc") _IELoadWait($ieo,0,60) Local $hWnd = WinExists("Windows Security") if $hWnd = 0 Then MsgBox($MB_OK, "Usage", "timeout") EndIf ControlFocus("Windows Security", "", "[CLASS:DirectUIHWND]") ControlFocus("Windows Security", "", "[CLASS:Edit; INSTANCE:1]")
  23. Was trying to launch Bluecoat application access via IE, which has windows authentication , i got it working to pass credentials but the access, after initial authentication has another java launcher for which i need to pass the credentials when the " Authentication Required " windows occur but there are 4 java security related windows appearing .My code so far is as below :- #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile=ps_test.exe #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <Constants.au3> #include <IE_v1.au3> #include <AutoItConstants.au3> If $CmdLine[0] < 2 Then MsgBox($MB_OK, "Usage", "ps_proxy <username> <password>") Else Proxy($CmdLine[1], $CmdLine[2]) EndIf Func Proxy($email, $password) Local $ie = _IECreate("https://1.1.1.1" , 1) Local $oIE = _IEAttach("Cert") _IELinkClickByText($oIE, "Continue to this website (not recommended).",0,0) If @error > 0 Then Local $i = 0 Do Sleep(500) $i = $i + 1 $ie = _IEAttach("1.1.1.1") Until VarGetType($ie) == "Object" Or $i >= 10 EndIf If VarGetType($ie) == "Object" Then $hwnd = _IEPropertyGet($ie, "hwnd") WinSetState($hwnd, "", @SW_MAXIMIZE) Local $hWnd1 = WinWait("[CLASS:DirectUIHWND]", "", 10) ControlClick($hWnd, "", "DirectUIHWND1") ; Send the Username Send($email, 1) Sleep(10) Send("{TAB}") ; Ensure we are in the Password field ; Send the Password Send($password, 1) Sleep(10) ; Submit the credentials Send("{ENTER}") WinWaitClose($hwnd) Else MsgBox($MB_OK, "Login Failure", "Password Safe failed to automate the login. If this problem persists please contact your Password Safe Administrator.") EndIf EndFunc ;==>Proxy() Can I put the below for the code to run till the authentication required window applies and then to pass the credentials again ? [CLASS:Authentication Required]", "", 5) ControlSend("Authentication Required", "", "", "username{TAB}password{TAB 2}{ENTER}") or should i use a while loop along with winlist ?and wait for windows to appear ?
×
×
  • Create New...