sammy1983 Posted April 27, 2017 Author Share Posted April 27, 2017 mLipok.. still waiting for you Link to comment Share on other sites More sharing options...
Developers Jos Posted April 27, 2017 Developers Share Posted April 27, 2017 @mLipok has a few days vacation and will be starting again during the Saturday graveyard shift. Jos mLipok 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
sammy1983 Posted April 27, 2017 Author Share Posted April 27, 2017 Can anyone assist me please? Link to comment Share on other sites More sharing options...
jdelaney Posted April 28, 2017 Share Posted April 28, 2017 You can focus in the dom object, and then use ControlSend/Send to set the value...the browser will think a human sent it that way. 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. Link to comment Share on other sites More sharing options...
sammy1983 Posted April 28, 2017 Author Share Posted April 28, 2017 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? Link to comment Share on other sites More sharing options...
jdelaney Posted April 28, 2017 Share Posted April 28, 2017 (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 April 28, 2017 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. Link to comment Share on other sites More sharing options...
sammy1983 Posted April 28, 2017 Author Share Posted April 28, 2017 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? Link to comment Share on other sites More sharing options...
junkew Posted April 28, 2017 Share Posted April 28, 2017 Navigate2 will be helping you with code like Javascript:whatever you want FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
sammy1983 Posted April 28, 2017 Author Share Posted April 28, 2017 16 minutes ago, junkew said: Navigate2 will be helping you with code like Javascript:whatever you want Can you show me the code how to do that? Link to comment Share on other sites More sharing options...
junkew Posted April 28, 2017 Share Posted April 28, 2017 $ie.navigate2 javascript:alert("hello world"); You have to play with single and double quotes around it FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
sammy1983 Posted April 28, 2017 Author Share Posted April 28, 2017 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? Link to comment Share on other sites More sharing options...
junkew Posted April 28, 2017 Share Posted April 28, 2017 With normal javascript jquery selectors just like how it would be done with javascript in the webpage. Google javascript selector. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
junkew Posted April 28, 2017 Share Posted April 28, 2017 (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 April 28, 2017 by junkew FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now