Jump to content

Recommended Posts

Posted

Thanks jdelaney for the response. I just tried Send option and it worked, however, I have a concern. While running IE in invisible mode and if I am working on Notepad or Excel or even on SciTE, will it not send those contents into these applications? If yes, how to bypass?

Posted (edited)

Nope.  Possibly controlsend, but doubtful.  I know there are some IE methods to 'keydown' and 'keyup'...but have never been able to get them to work.

You'll have to look into that, and see if it works as needed.

 

Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Posted

I tried ControlSend but not working. I am bit sceptical using Send as it has dependency. Can you let me know how to use ControlSend? Below is my code.

Control

ControlSend("BMC Remedy (Search)", "Remedy", $Notes1, "My text")

Am i doing anything wrong?

Posted
6 minutes ago, junkew said:

$ie.navigate2 javascript:alert("hello world");

You have to play with single and double quotes around it

Thanks junkew.. but how will your code identify the element? I mean how will it connect to the element and forward the content to it?

Posted (edited)

Its not the easiest with javascript but it is the most powerfull one

see also 

 

go to www.google.com and type (do not copy paste without putting javascript: again in front of it)

1. This just gives a messagebox on whatever is already in the search text box (normally empty)

javascript:alert(document.querySelector("input[id='lst-ib']").value);void(0);

2. Put something in the textbox

javascript:document.querySelector("input[id='lst-ib']").value='AutoIt .NET Common Language Runtime (CLR) Framework';void(0);

3. click on the button

javascript:document.querySelector("input[name='btnK']").click();void(0);

 

Above is very powerfull and works in general with all browsers. The only disbenefit can be you have to do a controlsend to your addressbar of the browser. And the nice part with IE.UDF you just can do $IE.Navigate2 

$IE.Navigate2 "javascript:document.querySelector("input[name='btnK']").click();void(0);"

and handle the " in a proper way with chr(34)

 

div class="btntextdiv"

you can write as  div[class='btntextdiv'] for the querySelector.

Just google querySelector / querySelectorAll and you will find enough examples on how to do stuff with selector logic in javascript

Edited by junkew

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...