
Chance1
Active Members-
Posts
53 -
Joined
-
Last visited
Everything posted by Chance1
-
@Jos this is an unrealted question to the topic but to what you suggested. When I run the powershell and try to use STDIO, I cannot see the powershell commands being send so I am not sure how to test this code. When I use @SW_SHOW or @SW_MAXIMIZE i just get a blank powershell window running. So I do not know if the commands are working or not.
-
@Jos that may help a little bit. but, the problem is that there is a mixture in the controlsend. Here is what I am trying to send to the powershell. ControlSend($hWnd, '', '', 'Enter-PSSession -ComputerName ' & $Domain & ' -Credential ' & $TargetUsername ) (So that is a powershell command being sent to the powershell window with Autoit). So that link may be helpful, but it might be too tedious to have to force the shift, ALT, or Crtl key to do down or not.
-
Hello, I am trying to send some commands to a powershell window using the ControlSend function. I get the handle of the powershell window and send the command, the command consists of upper and lower case letters within words, as well as '-' and variables. The ControlSend will also change the variables that are being send to the powershell (by change the variables I mean it changes the letters from upper to lower as well as changing say a zero '0' to ')' ). There is no pattern as sometimes the command is sent properly, but more times than not, the command has something wrong. Has anyone experienced this before? Know of a way to fix this? Thanks!
-
Just the scripts in the examples page are buggy. ; Open browser with basic example, click on the link with text "user forum" #include <IE.au3> Local $oIE = _IE_Example("basic") _IELinkClickByText($oIE, "user forum") It creates the IE window and clicks the link that it is trying to click, but the page is never able to load. It's pretty much the same issue I am having in my script. However, it could be something with my machine and not autoit at all. Was just curious as to if anyone else had encountered this. Also, The page I am trying to interact with is a the warning page that suggests you to not continue to the webpage. The antivirus doesn't like it for some times. So if the page pops up, I want to click the link that says "Continue to this website (not recommended)." And yes, I have tried the following _IELinkClickByText($oIE, "Continue to this website (not recommended). ") _IELinkClickByIndex($oIE, 2) And neither work.
-
Oh yes I see that now, than you. It seems to be a little buggy however, does anyone else feel that way? I think I might stick with the control click for now. edit: it could also just be the page that I am working with too.
-
Hey guys, I am looking for a way to click on a link in an IE window. The only commands I could find were _IELinkClickByText and _IELinkClickByIndex, and when using Autoit Window Info there is nothing that comes up for those two Controls. I could use controlclick on the position, but I was curious as to if there was a better way to do so or am I going to be stuck using control click? Thanks in advance.
-
Click onclick Button Javascript
Chance1 replied to Chance1's topic in AutoIt General Help and Support
I get that onclick is an event and then on the right side of that same window it says signin(2). When I click on it get to a window that is just filled up with javascript. Not sure how to decipher this. edit: all of the onclick commands in the seperate window are all set to "return false" -
Click onclick Button Javascript
Chance1 replied to Chance1's topic in AutoIt General Help and Support
so that didn't work either. I am looking throught the developer tool and am not finding too much. I have attaed a screenshot of the script. You can see a bunch of things being triggered before the signon button, but non of those are actually changing the sign in. There is no function that it runs onclick. The table is just the window that the fields are being displayed in. Not to sure what to do at this point. Thanks guys for all of your help. -
Click onclick Button Javascript
Chance1 replied to Chance1's topic in AutoIt General Help and Support
doesn't work, there is no form. Or I just cannot find the form. I even tried _IEFormSubmit($oIE) and that doesn't work either -
Click onclick Button Javascript
Chance1 replied to Chance1's topic in AutoIt General Help and Support
I am working on automating a different javascript doing a similar procedure but the javascript is different then what it was with the last one. So far, I am able to populate the username and password, but I have had no luck clicking the Sign In button again. This is due to the fact that the java script is different. They are not in a form, so I collect the fields like this: Local $o_user = _IEGetObjByName ($oIE, "pt1:_pt_it1") ;text box for sign in Local $o_password = _IEGetObjByName ($oIE, "pt1:_pt_it2") ;text box for password Local $o_signin = _IEGetObjById ($oIE, "pt1:_pt_cb1") ;have to get obj by ID because there is no name for it And the javascript for the button looks like this: <button class="x7j p_AFTextOnly" id="pt1:_pt_cb1" onclick="return false;">Sign In</button> I tried the following with no luck: _IEAction($o_signin, "click") _IEFormElementSetValue ($o_user, $TargetUsername) ;enter in username Sleep(2000) _IEFormElementSetValue ($o_password, $TargetPassword & @CR); Enter a password -- & @CR to hit enter -- doesn't work _IEFormElementSetValue ($o_signin, "") ;strike the "Sign In" button The last of those two actually working on the previous script. -
Click onclick Button Javascript
Chance1 replied to Chance1's topic in AutoIt General Help and Support
Yes That does work! -
Click onclick Button Javascript
Chance1 replied to Chance1's topic in AutoIt General Help and Support
You are correct, when I have only "" in the second parameter, the command still works, meaning the sing in button is hit. Could that be because of how I get the object? Local $o_signin = _IEFormElementGetObjByName ($o_form, "SUBMIT_BUTTON") -
Click onclick Button Javascript
Chance1 replied to Chance1's topic in AutoIt General Help and Support
i just went back and tested my code using _IEFormElementSetValue ($o_user, $TargetUsername) Sleep(200) _IEFormElementSetValue ($o_password, $TargetPassword & "{ENTER}") Sleep(200) ; _IEFormElementSetValue ($o_signin, "{ENTER}") So that the last line is commented out and the sign in did NOT occur. That being said, I would need to have the last line code in order to sign in. -
Click onclick Button Javascript
Chance1 replied to Chance1's topic in AutoIt General Help and Support
Thinking about it now, I didn't need to click the button, all I had to do was send an {ENTER} while in either of the username or password fields. Hitting enter acts like hitting the Sign In button. So, I actually do not know if my could about is actually hitting enter of the sign in button or just hitting enter while being in a field causing the sign in to occur. -
Click onclick Button Javascript
Chance1 replied to Chance1's topic in AutoIt General Help and Support
I got it! I am not usre why I didn't try this before but I was going off the controlsend {ENTER} idea. This code works _IEFormElementSetValue ($o_user, $TargetUsername) Sleep(200) _IEFormElementSetValue ($o_password, $TargetPassword) Sleep(200) _IEFormElementSetValue ($o_signin, "{ENTER}") the first two populate the username and the password portions for the form, the last one hits the sign in button. Thank you to the guys who helped, I really appreciate it. -
Click onclick Button Javascript
Chance1 replied to Chance1's topic in AutoIt General Help and Support
@Danp2 That is a very clever idea. I cannot seem to get it working but maybe I am getting the handle wrong. I am trying this, local $hWnd = _IEAction($oIE, "hwnd") sleep(200) _IEAction($o_signin, "focus") sleep(200) ControlSend($hWnd, '', "[CLASS:Internet Exploerer_server; INSTANCE:1]", "{ENTER}") sleep(200) But it was not working -
Click onclick Button Javascript
Chance1 replied to Chance1's topic in AutoIt General Help and Support
I tired it and also had no luck. I also tried sleep(2000) _IEFormImageClick ($oIE, "/xmlpserver/xdo/images/spacer.gif", "src") _IELoadWait($oIE) but I ended up getting an error in the IE.au3 script. I also tried this, where $o_signin is the "Sign On" button, also no luck. sleep(2000) _IEImgClick ($o_signin, "/xmlpserver/xdo/images/spacer.gif", "src") _IELoadWait($oIE) -
Click onclick Button Javascript
Chance1 replied to Chance1's topic in AutoIt General Help and Support
I tired using sleep(2000) _IEFormSubmit($o_form) sleep(100) with no luck -
Click onclick Button Javascript
Chance1 replied to Chance1's topic in AutoIt General Help and Support
function normalLogin(event){ if(event && event.preventDefault) { event.preventDefault(); } else { event.returnValue = false; } var errMsg = "Please enter username and password"; if(document.loginform.id.value == null || '' == document.loginform.id.value) { alert(errMsg); return false; } else { document.loginform.submit(); } }; -
Click onclick Button Javascript
Chance1 replied to Chance1's topic in AutoIt General Help and Support
think it could be something with the way it is clicking? I have seen on a couple different forums that you have to fire the onmouseodwn and onmouseup events. I tried it but with no luck, this is what I tried: Local $oInputs = _IETagNameGetCollection($oIE, "input") For $oInput in $oInputs If StringStripWS($oInput.value, 7) = "Sign In" Then $oInput.fireEvent("onmousedown") $oInput.fireEvent("onmouseup") _IEAction($oInput, "click") EndIf Next Keep in mind I have never tried to trigger events so I could be trying to do this complete wrong. Any thoughts on this or know how I could clean up my syntax? Thanks. -
Click onclick Button Javascript
Chance1 replied to Chance1's topic in AutoIt General Help and Support
unfortunately I cannot because it is business related. -
Click onclick Button Javascript
Chance1 replied to Chance1's topic in AutoIt General Help and Support
I have tried a couple different variations of the code you provide, changing the if statement and such, still not luck.I was testing it and saw that it does go into the Then clause but still no click occurred. Any idea why? Why would I want to check the input without white space?