Jump to content
Macro Express Forums

Clicking on a button that moves


kmaster
 Share

Recommended Posts

Here is my problem. I have a button that I want to click on to upload files to a website. But every file I upload will cause the button to move futher down the page. I tried to use cntrl f to find the button on the page, but it cannot find the button. Any suggestions on how I can find this button and click it?

 

Thanks in advance.

 

Kris

Link to comment
Share on other sites

Here is my problem. I have a button that I want to click on to upload files to a website. But every file I upload will cause the button to move futher down the page. I tried to use cntrl f to find the button on the page, but it cannot find the button. Any suggestions on how I can find this button and click it?

 

Thanks in advance.

 

Kris

In my experience, this is one of the trickiest, sometimes most difficult, actions to automate with Macro Express.

 

Ideally, you should just be able to use the Get Control command to assign the button to, let's say, %C1%, and then

use the Mouse Click Control command to click the button. Unfortunately, fewer and fewer web pages and other

applications are compatible with the Control commands, so there isn't any guarantee that this will work.

 

However, if you haven't already tried it, that is what I would suggest, because if it does work, then this is by far the best

way to do it.

Link to comment
Share on other sites

Here is my problem. I have a button that I want to click on to upload files to a website. But every file I upload will cause the button to move futher down the page. I tried to use cntrl f to find the button on the page, but it cannot find the button. Any suggestions on how I can find this button and click it?

 

Searching for a button can be made to work. From your description, it sounds like the button you want to activate is an actual pushbutton, not a hypertext link styled to look like a button. It is not possible to search for pushbuttons because they do not consist of actual text.

 

This web site (pgmacros) has many examples of non-text buttons. For example, when you are composing a message on this forum, you cannot search for the "Add Reply" button because the words are not actual text. So you cannot use your browser's find command to move to the "Add Reply" button.

 

But try this:

 

Identify unique text that occurs NEAR the "Add Reply" button, e.g., "Enable email notification of replies?" or "Use None." Then search for that text. Then Tab one or more times until the button gets focus. (If you search for text that appears after the button, use Shift + Tab.) Then press spacebar to activate the button.

 

The macro will look something like this:

 

//Initiate find

Text Type <CONTROL>f

// Wait for Find dialog to appear...

Wait 200 ms

// Search for text...

Text Type "Use None"

// Start Search

Text Type <ENTER>

// Close Find dialog...

Text Type <ESC>

// Wait for Find dialog to go away...

Wait 200 ms

// Tab to Add Reply button...

Text Type <TAB>

// Activate it...

Text Type <SPACEBAR>

 

 

This is not a bulletproof solution, but I hope it gets you started.

 

You should also check the source to see if whether the web developers use the accesskey attribute for anything. If yes, you may be in luck. Accesskey is a hotkey to navigate to a fixed location on a page. For example, if the accesskey for a link is "X", then you can navigate directly to that link with Alt + X (IE) or Shift + Alt + X (Firfox). Then Tab or Shift + Tab to your target, as above.

 

If you check the source for this page, you will discover this line:

 

<input type="submit" name="dosubmit" value="Add Reply" tabindex="7" class="button" accesskey="s" />

 

That's the code for the "Add Reply" button, which has accesskey = "s", which means you can activate it directly with Alt + S (IE) or Shift + Alt + S (Firefox). No searching required!

Link to comment
Share on other sites

Searching for a button can be made to work. From your description, it sounds like the button you want to activate is an actual pushbutton, not a hypertext link styled to look like a button. It is not possible to search for pushbuttons because they do not consist of actual text.

 

This web site (pgmacros) has many examples of non-text buttons. For example, when you are composing a message on this forum, you cannot search for the "Add Reply" button because the words are not actual text. So you cannot use your browser's find command to move to the "Add Reply" button.

 

But try this:

 

Identify unique text that occurs NEAR the "Add Reply" button, e.g., "Enable email notification of replies?" or "Use None." Then search for that text. Then Tab one or more times until the button gets focus. (If you search for text that appears after the button, use Shift + Tab.) Then press spacebar to activate the button.

 

The macro will look something like this:

 

//Initiate find

Text Type <CONTROL>f

// Wait for Find dialog to appear...

Wait 200 ms

// Search for text...

Text Type "Use None"

// Start Search

Text Type <ENTER>

// Close Find dialog...

Text Type <ESC>

// Wait for Find dialog to go away...

Wait 200 ms

// Tab to Add Reply button...

Text Type <TAB>

// Activate it...

Text Type <SPACEBAR>

 

 

This is not a bulletproof solution, but I hope it gets you started.

 

You should also check the source to see if whether the web developers use the accesskey attribute for anything. If yes, you may be in luck. Accesskey is a hotkey to navigate to a fixed location on a page. For example, if the accesskey for a link is "X", then you can navigate directly to that link with Alt + X (IE) or Shift + Alt + X (Firfox). Then Tab or Shift + Tab to your target, as above.

 

If you check the source for this page, you will discover this line:

 

<input type="submit" name="dosubmit" value="Add Reply" tabindex="7" class="button" accesskey="s" />

 

That's the code for the "Add Reply" button, which has accesskey = "s", which means you can activate it directly with Alt + S (IE) or Shift + Alt + S (Firefox). No searching required!

 

 

 

That was what I did earlier and it worked great.

 

thanks for all the help and suggestions. you guys are the best.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...