Jump to content

Simple chrome automation question


Recommended Posts

I want to automate the process of clearing all my cookies in chrome, when I develop my app, the cookies often get in the way. Anyways here is the script that I have

Opt("WinTitleMatchMode", 2)
WinActivate("Facebook - Google Chrome", "")
WinWaitActive("Facebook - Google Chrome", "")
sleep(1000)
send("^+{DEL}")
sleep(1000)

What this does is that it will activate my facebook page, press control, shift delete and activate my cookie delete page. the step that I am stuck at is pressing the buttom that says "Clear browsing data"

I tried ControlClick("Facebook - Google Chrome", "Clear browsing data", ""), which obviously didn't work, I don't think the pop up from chrome has a control ID since I tried the autoit window info program and it didn't give me 1.

<It Shall Be Done>
Link to comment
Share on other sites

that is a way, but it's not a 'sure' way of getting it to work, what if it takes different number of tab keys for one time, then it wouldn't work. Is there a way that I can veryify if the control the tab is focusing on indeed is the control I want, for exaple, by reading the text?

<It Shall Be Done>
Link to comment
Share on other sites

Would it be possible for you to instead launch chrome into ingonito mode?

This syntax would be Chrome.exe -incognito

This should take care of your cookie problem since any pages in that mode cant store cookies for any longer then they are open.

Link to comment
Share on other sites

that is a way, but it's not a 'sure' way of getting it to work, what if it takes different number of tab keys for one time, then it wouldn't work. Is there a way that I can veryify if the control the tab is focusing on indeed is the control I want, for exaple, by reading the text?

But it dosent does it? it takes 10 tabs.

If you want to use co-ordinates and like a pixelchecksum or whatever then thats another way, then you have resolution issues, if you are planning to distribute your code.

I thing the tabs are the best way, but I'm sure there will be people with other ideas. But unfortunately you cannot control Crome as you can IE, or even FF with the addon installed.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...