Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

Control Web Page


  • Please log in to reply
30 replies to this topic
vanessa
  • Guests
  • Last active:
  • Joined: --
I have a page of internet explorer that I need to control. I need to go to certain tabs or fields automatically (preferably without mouse movements) is this possible? If so I would appreciate an example. The source is:



ONE - Produção - Servidor 12













Thanks

jethrow
  • Moderators
  • 2854 posts
  • Last active: May 17 2017 01:57 AM
  • Joined: 24 May 2009
How advanced do you want to go? If you're using IE, the most effective way would be using COM, but that is a little more advanced. Otherwise, I would recommend using Javascript, which can be fed throught the URL Address Bar of most popular webbrowsers.

vanessa
  • Guests
  • Last active:
  • Joined: --

How advanced do you want to go? If you're using IE, the most effective way would be using COM, but that is a little more advanced. Otherwise, I would recommend using Javascript, which can be fed throught the URL Address Bar of most popular webbrowsers.


I'm really a newbie in these things. Can you give me an example of how it would be with COM and with Java?

Where can I read and learn the basics on this topic ...

Thanks

jethrow
  • Moderators
  • 2854 posts
  • Last active: May 17 2017 01:57 AM
  • Joined: 24 May 2009
Here's a COM example (requires COM Standard Library - see my signature)

Here's a Javascript example (not Java :wink: ) - simpler - IMO better for a noobie

Where can I read and learn the basics on this topic ...

W3Schools is a great website.

vanessa
  • Guests
  • Last active:
  • Joined: --
I'm having difficulties in capturing the elements of the page (It’s a Siebel application). HTML Element Spy only capture frames things like:


Any ideas?
Thanks

jethrow
  • Moderators
  • 2854 posts
  • Last active: May 17 2017 01:57 AM
  • Joined: 24 May 2009
I recently had this conversation with someone - it might prove useful to you

Try this:

javascript: alert(frames.length)

This reports 2.

I might try seeing if the element is in one of the frames. I would go about this by checking the innerText (or innerHTML) of each frame to see if the element is in one of those frames. This can be done like this (note the collection starts at 0 - so you would check frame[0] & frame[1]):

javascript: alert(frames[0].document.documentElement.innerText) ; or innerHTML
If you do find that the element is in one of the frames, try clicking it like this:
javascript: frames[[color=red]#[/color]].document.all.name.click()
If you still have no luck, see if there are frames within this frame (this can get frustrating - I know ):
javascript: alert(frames[[color=red]#[/color]].frames.length)
I would keep working down into the frames until I found for sure what frame the element is in, then use the entire path to try to click it with javascript. I have some webpages at work that require something like this:
javascript: frames[2].frames[3].frames[1].document.all.name.click()



tank
  • Administrators
  • 4345 posts
  • AutoHotkey Foundation
  • Last active: May 02 2019 09:16 PM
  • Joined: 21 Dec 2007
<!-- m -->https://ahknet.autoh... ... corder.zip<!-- m -->

the above link will give you frame depth by simply hmoving your mouse over an element
Never lose.
WIN or LEARN.

jethrow
  • Moderators
  • 2854 posts
  • Last active: May 17 2017 01:57 AM
  • Joined: 24 May 2009
@ tank - very nice! I hadn't specifically noted this functionallity in your program. I noticed it gives frame depth, as you stated, but I didn't notice the frame index numbers (frame[1].frame[3].frame[2]). Am I just missing this? Or do you have any plans of implementing this in the future? (or is there a more effective way of accessing this frame that I don't know about?)

tank
  • Administrators
  • 4345 posts
  • AutoHotkey Foundation
  • Last active: May 02 2019 09:16 PM
  • Joined: 21 Dec 2007

@ tank - very nice! I hadn't specifically noted this functionallity in your program. I noticed it gives frame depth, as you stated, but I didn't notice the frame index numbers (frame[1].frame[3].frame[2]). Am I just missing this? Or do you have any plans of implementing this in the future? (or is there a more effective way of accessing this frame that I don't know about?)

Its already there IMO Seans Element Spy does this as well

edit see image

notice it shows frame1 this is one frame in from the primary document
it shows the frame element is at sourceindex 46 and has an id but no name

but no it will not show the frame index itself because i havent nor has Sean found an applicable programatic way of doing it
Posted Image
Never lose.
WIN or LEARN.

vanessa
  • Guests
  • Last active:
  • Joined: --
Thanks for the answers :-)

The Web recorder captures the innertext of the buttons

[innertext]=Consultar

Can I "send a press" to particular button based on the innertext?

tank
  • Administrators
  • 4345 posts
  • AutoHotkey Foundation
  • Last active: May 02 2019 09:16 PM
  • Joined: 21 Dec 2007
of course but you will need to use or write your own com library based functions to do so
iWeb functions
but i dont have the time for a thourogh walk thru

com_init()
pwb:=iweb_getwin("somepage title")
iweb_clickdomobj(pwb,"text of link you wish to click")

Never lose.
WIN or LEARN.

vanessa
  • Guests
  • Last active:
  • Joined: --
Ok. Thanks
I have a lot to try...
I'LL be back :-)


jethrow
  • Moderators
  • 2854 posts
  • Last active: May 17 2017 01:57 AM
  • Joined: 24 May 2009

but no it will not show the frame index itself because i havent nor has Sean found an applicable programatic way of doing it

duh jethrow, why don't you just access the frames by name/id. See, I learn eventually :D

@vanessa - you already have the element id - why not access it by that?
javascript: document.all.[color=red]id=[/color]s_1_1_7_0_mb.click()

EDIT - see the next post by tank :oops: - don't include the id=

tank
  • Administrators
  • 4345 posts
  • AutoHotkey Foundation
  • Last active: May 02 2019 09:16 PM
  • Joined: 21 Dec 2007

@vanessa - you already have the element id - why not access it by that?

javascript: document.all.id=s_1_1_7_0_mb.click()

dont you mean
javascript: document.all.s_1_1_7_0_mb.click()

Never lose.
WIN or LEARN.

vanessa
  • Guests
  • Last active:
  • Joined: --
javascript on the address bar doesn't work in this application...

Not even things like :
javascript: alert(document.forms[0].elements[0].value)
:? :? :? :? :?