Click on the web form textbox or button with ID or Class

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
nehulagr
Newbie
Posts: 4
Joined: Mon Aug 20, 2012 5:03 pm

Click on the web form textbox or button with ID or Class

Post by nehulagr » Mon Aug 20, 2012 5:07 pm

I know i am asking a stupid question here everyone can figure that out. But believe me i really tried hard to get it but unfortunately not got it.

So i Just want a simple thing i want to click on a web form text field by its ID or Name or class. And i dont want to press TAB so how can i do that? I want same for the button or any web form field.

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Aug 21, 2012 7:03 am

The easiest way to do this is first to install webrecorder then you can use the IE_ClickTag function which can be given the ID or class of the element.

alternatively use IEGetTags to first get an array of all tags matching tag type and then loop through them to locate the one of interest and store the index and use IETagEvent to click it.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

nehulagr
Newbie
Posts: 4
Joined: Mon Aug 20, 2012 5:03 pm

Thanks!! But not working with Firefox

Post by nehulagr » Tue Aug 21, 2012 8:22 am

Thanks for your kind reply it works for me.

But what when i want to work with Firefox or some other browser? as i am not getting its accessibility there.

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Aug 21, 2012 9:32 am

Our functions work only with IE as they depend on IE's API/Document Object Model. If you wish to automate Firefox/Chrome you would have to use "user-level" automation.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

carles1988
Newbie
Posts: 1
Joined: Fri Aug 03, 2012 9:27 pm

Post by carles1988 » Wed Aug 22, 2012 4:15 pm

mtettmar wrote:Our functions work only with IE as they depend on IE's API/Document Object Model. If you wish to automate Firefox/Chrome you would have to use "user-level" automation.
How would I use "user-level" automation? Can I use it in bing or in chrome?

ocnuybear
Pro Scripter
Posts: 100
Joined: Sun Jul 15, 2018 5:14 pm

Re: Click on the web form textbox or button with ID or Class

Post by ocnuybear » Mon Jul 23, 2018 9:20 am

Hi Marcus,

I'm also trying to work with Chrome, trying to send Space or k yo play pause youtube video, but it is not working, also tried to send a mouse left click, but it is not working.

Can you please elaborate on "user-level" programming?

ocnuybear
Pro Scripter
Posts: 100
Joined: Sun Jul 15, 2018 5:14 pm

Re: Click on the web form textbox or button with ID or Class

Post by ocnuybear » Tue Jul 24, 2018 12:10 pm

The closest that I got to automate Chrome would be to use shortcut keys with the following code:

Code: Select all

GetWindowHandle> - Google Chrome*,hWndParent
SetFocus> - Google Chrome*
FindObject>hWndParent,Chrome_RenderWidgetHostHWND,,1,hWnd,X1,Y1,X2,Y2,result
ObjectSendKeys>hWnd,VK75
Which works great to send "k" to a youtube video, pausing and playing it - so some functionality (limited) can be done this way.

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts