RDT Posted December 18, 2008 Report Share Posted December 18, 2008 Looking to find the best way to initiate a check box (click it) on a webpage. The problem is getting the mouse to the check box location. There are a ton of links on the page and I have use the page down command to just see the check box. I used the mouse locator by it does not take the page down command into place. So I am at a loss at this point to get my mouse on the check box. What is the best way to handle this? Quote Link to comment Share on other sites More sharing options...
terrypin Posted December 18, 2008 Report Share Posted December 18, 2008 Looking to find the best way to initiate a check box (click it) on a webpage. The problem is getting the mouse to the check box location. There are a ton of links on the page and I have use the page down command to just see the check box. I used the mouse locator by it does not take the page down command into place. So I am at a loss at this point to get my mouse on the check box. What is the best way to handle this? Just duplicate the exact steps you are taking to click it manually. That includes the one or more Text Type: <PAGE DOWN> commands to achieve what you've described, before the mouse commands. This assumes, of course, that the link remains in a consistent location. If it doesn't then you have a more complex macro to write. I'm also assuming that you can't reach the check box by the more obvious method of tabbing. -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
kunkel321 Posted December 18, 2008 Report Share Posted December 18, 2008 I would agree with Terry, I haven't used this exact set up, but I think that pressing Page Down should reliably scroll the page down the same number of pixels each time it's evoked. As such, Text Type <PAGE DOWN>, then Move mouse to location X, Y (relative to window; not screen) and click. If there are problems with the checkbox moving further down as the webpage loads you *might* be able to do a "Wait for webpage to load" delay before clicking.... -sk Quote Link to comment Share on other sites More sharing options...
stan Posted December 18, 2008 Report Share Posted December 18, 2008 If you can Tab to the check box, another option may be to use the browser's Find function (depending on how the page is written). Find some unique text located right before the check box. Then Tab once to the check box. You can quickly test this manually to see if it will work on the site before writing a macro to do it. Pressing the Space Bar once typically checks or un-checks the box. Quote Link to comment Share on other sites More sharing options...
acantor Posted December 18, 2008 Report Share Posted December 18, 2008 If you can Tab to the check box, another option may be to use the browser's Find function (depending on how the page is written). Find some unique text located right before the check box. Then Tab once to the check box. You can quickly test this manually to see if it will work on the site before writing a macro to do it. Pressing the Space Bar once typically checks or un-checks the box. I have done it this way, and the approach is do-able, but scripts to automate the process tend to be flaky. Searches in Firefox work differently (and are more customizable) than searches in IE, so you may need different macros for each browser. Depending on the page, it may be more reliable to search for text AFTER the checkbox, and press Shift+Tab to reach it. See whether the the authors of the page use the "accesskey" attribute. Open the source, and search for "accesskey." If yes, you are in luck, because accesskey provides an elegant way to navigate to form controls. If the accesskey for the checkbox you want to activate is, say, "T", then you can navigate directly to the checkbox by pressing Alt + T (IE) or Shift + Alt + T (Firefox). Even if there is no accesskey to the particular checkbox, but there are accesskeys to other form controls or links, you will have an navigational "anchor" available. For example, if there is an accesskey (say "X") that puts focus on the link 10 tabs before the checkbox, you could write a script like this: Text Type Alt + X Repeat 10 times Text Type Tab Repeat End Type Text spacebar Quote Link to comment Share on other sites More sharing options...
RDT Posted December 19, 2008 Author Report Share Posted December 19, 2008 Thanks for the great idea Alan. Will put this in play ASAP. Now to deal with timing issues. I have done it this way, and the approach is do-able, but scripts to automate the process tend to be flaky. Searches in Firefox work differently (and are more customizable) than searches in IE, so you may need different macros for each browser. Depending on the page, it may be more reliable to search for text AFTER the checkbox, and press Shift+Tab to reach it. See whether the the authors of the page use the "accesskey" attribute. Open the source, and search for "accesskey." If yes, you are in luck, because accesskey provides an elegant way to navigate to form controls. If the accesskey for the checkbox you want to activate is, say, "T", then you can navigate directly to the checkbox by pressing Alt + T (IE) or Shift + Alt + T (Firefox). Even if there is no accesskey to the particular checkbox, but there are accesskeys to other form controls or links, you will have an navigational "anchor" available. For example, if there is an accesskey (say "X") that puts focus on the link 10 tabs before the checkbox, you could write a script like this: Text Type Alt + X Repeat 10 times Text Type Tab Repeat End Type Text spacebar Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.