Jump to content

click button on chrome


Recommended Posts

hi guys im trying to automate some things but clickin buttons on chrome...

i have had a read through help file but couldnt seem to make it work.. guessing because its Chrome and not IE?

Is there a way to ctrl + f to find edit then click it on it (seems like the easiest work around)??

Otherwise am i still able to click a button using the class name? class name is button.gwt-Button.Blue

#include <Excel.au3>

$oExcel = _ExcelBookOpen("T:\Inzb\Documents\Load Support\Tom\Projects\CPL\editsavelist.xlsx") ;excel book
winactive("CPL - Google Chrome")
sleep(500)
For $i = 1 to 1471
   $cityname = _ExcelReadCell($oExcel, $i, 1)
   $suppname = _ExcelReadCell($oExcel, $i, 2)

winactive("CPL - Google Chrome")

MouseClick ("Left", 112,187,1,10)
Sleep(500)
send("{DELETE}")
send("{DELETE}")
send("{DELETE}")
send($cityname)
sleep(500)
send("{TAB}")
sleep(500)
send("{DELETE}")
send("{DELETE}")
send("{DELETE}")
send($suppname)
sleep(500)
Send("{ENTER}")
sleep(1000)
ControlClick("CPL - Google Chrome","",CLASS:button.gwt-Button.Blue)
sleep(1000)
mouseclick ("left",968,155,1,10) ;save
sleep(2600)
mouseclick ("left",167,143,1,10) ;find property

Next

msgbox(0,"FINISHED","FINISHED")
Link to comment
Share on other sites

i have to use chrome as the website im using doesnt load in anything but chrome so was hoping to find a work around because i was pretty sure i cant use IE functions with chrome etc... thats why my first idea would be to find edit then click it but i have no idea how to do that...

I would just keep mouse clicks but the hotel name changes length meaning the edit button changes location.

also cant use send tabs because the amount of tabs to send is not always the same...

Edited by 13lack13lade
Link to comment
Share on other sites

it would be much easier to do this in IE or FireFox.

however, if you have to use chrome, then i would suggest trying imagesearch.

it is not the easiest thing to do but it is a work around. you can search for images on the screen like the save button or input boxes and use mouseclick.

here is a little thing i put together since i couldnt find the original. hopefully it will help you.

ImageSearch.zip

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...