Jump to content
Sign in to follow this  
plastix

Chrome Automation of existing instance

Recommended Posts

Hi all

Can IUIAutomation automate existing instances of Chrome to find objects (by ID, for example) within iframes and set text of inputs within them ?  I need to basically poll existing Chrome instances regularly to see if a login form is loaded (which will itself be loaded in an iframe potentially within any number of tabs/instances). Chrome will have accessibility 'on', but there are restrictions that won't permit the installation of any non-mainstream extensions etc (othewise would have looked at the _Chrome_UDF). I started dabbling with Selenium (via Selenium Wrapper ) and it worked well spawning an instance of Chrome browser etc - but I later realised that it can't attach to an existing instance of Chrome... I've looked at Junkew's IUIAutomation framework and could see might be feasible to manipulate controls by click etc - but not necessarily at a DOM / DOM tree level...

Anyone got any experience / success with this specific issue ? TIA ;)

 

Share this post


Link to post
Share on other sites

No problem you just can attach to running instance with iuiautomation. With tab accessibility of chrome you can see the default exposed tree. By entering javascript lines thru the addressbar the sky will be the limit on what you can see in chrome but also other browsers.

Edited by junkew

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By FUD
      hello 
      please i need help 
      i need to open link in default browser only one windows without duplicate if i try to open the same link 
       
      thanks 
    • By Colduction
      Hi guys, i want to convert WebKit/Chrome timestamps that i've found in chrome cookie database to Human-Readable time (if possible, with UTC or GMT offset).
      Example of WebKit/Chrome timestamp: 13228999534132232 Output that i want: 2020-03-18 20:16:56 This site has a tool to do this work, but i wonder how to convert this time (this timestamp's time bases are 1600/01/01) to human-readable time:
      https://www.epochconverter.com/webkit
    • By Colduction
      Hi everyone! i have Two-Problems:
      I've used this code to decode and export cookies from Google Chrome application's "C:\Users\%username%\AppData\Local\Google\Chrome\User Data\Default\Cookie" file but i can't receive any data: #include <CryptProtect.au3> #include <SQLite.au3> #include <SQLite.dll.au3> Global Const $g_sLoc_Output = @ScriptDir & "\Cookies.txt" If FileExists($g_sLoc_Output) Then FileDelete($g_sLoc_Output) EndIf $hFO_Output = FileOpen($g_sLoc_Output ,1) If $hFO_Output <> -1 Then FileWrite($hFO_Output, Chrome()) FileFlush($hFO_Output) FileClose($hFO_Output) EndIf Func Chrome() Local $q, $r, $sOutput, $sLoc_ChromeDB = EnvGet("localappdata") & "\Google\Chrome\User Data\Default\Cookies" If FileExists($sLoc_ChromeDB) = False Then Return "" _SQLite_Startup() If @error Then MsgBox(16, "SQLite Error", "SQLite3.dll Can't be Loaded! - " & $__g_hPrintCallback_SQLite & @CRLF & @CRLF & "Exiting application") Exit -1 EndIf _SQLite_Open($sLoc_ChromeDB) _SQLite_Query(-1, 'SELECT host_key, name, value, encrypted_value FROM cookies', $q) While _SQLite_FetchData($q, $r) = 0 $sOutput = $sOutput & r[0] & @CRLF & r[1] WEnd _SQLite_Close() _SQLite_Shutdown() Return $sOutput EndFunc I've used this code too for decrypt my saved passwords and export from Google Chrome application's "C:\Users\%username%\AppData\Local\Google\Chrome\User Data\Default\Login Data" file but i can't get decrypted data: #include <CryptProtect.au3> #include <SQLite.au3> #include <SQLite.dll.au3> Global Const $g_sLoc_Output = @ScriptDir & "\Credentials.txt" If FileExists($g_sLoc_Output) Then FileDelete($g_sLoc_Output) EndIf $hFO_Output = FileOpen($g_sLoc_Output ,1) If $hFO_Output <> -1 Then FileWrite($hFO_Output, Chrome()) FileFlush($hFO_Output) FileClose($hFO_Output) EndIf Func Chrome() Local $q, $r, $sOutput, $sLoc_ChromeDB = EnvGet("localappdata") & "\Google\Chrome\User Data\Default\Login Data" If FileExists($sLoc_ChromeDB) = False Then Return "" _SQLite_Startup() If @error Then MsgBox(16, "SQLite Error", "SQLite3.dll Can't be Loaded! - " & $__g_hPrintCallback_SQLite & @CRLF & @CRLF & "Exiting application / Zavolej Honzovi") Exit -1 EndIf _SQLite_Open($sLoc_ChromeDB) _SQLite_Query(-1, "select * from logins;", $q) While _SQLite_FetchData($q, $r) = 0 $sOutput = $sOutput & "======================| " & $r[7] & " |======================" & @CRLF & "Login URL: " & $r[0] & @CRLF & "Email/User: " & $r[3] & @CRLF & "Password: " & _CryptUnprotectData($r[5], "") & @CRLF & @CRLF WEnd _SQLite_Close() _SQLite_Shutdown() Return $sOutput EndFunc Thanks!
    • By water
      Internet Explorer is nearly dead, newer versions of Firefox can't any longer be automated using Stilgar's FF UDF.
      Hence more and more users (including me) need to look at automating Webbrowsers using WebDriver.
      That's why I have started to create a tutorial in the wiki.
      It should describe all necessary steps from intallation to usage.

      I'm still collecting ideas for the tutorial - that's where you come into play.
      What do you expect to see in such a tutorial?
      Which browsers should be covered (Firefox, Chrome and Edge are settled)? Any questions for the FAQ? Which (high level) coding examples do you expect (like "How to attach to a running browser instance") ... Like to see your comments
       
      ToDo-List:
      Add "Tools" section and add ChroPath plugin. Done. FAQ: "How to attach to a running browser instance". Done. Explain the difference between iuiautomation, iaccessible, autoit, webdriver. Done. The AutoIt FAQ 40 has been extended. Detailed description of each function. Done Example for "how to deal with downloading". Use function _WD_DownloadFile. Example for "how to deal with popups (alerts, print or save dialog). Use function_WD_AlertRespond to respond to a user prompt. Example for "how to deal with multiple tabs". Use functions _WD_NewTab (create a new tab), _WD_Window (close or switch to a tab) and _WD_Attach (attach to existing tab).
×
×
  • Create New...