-
Recently Browsing 0 members
No registered users viewing this page.
-
Similar Content
-
By shelly
I have to press tab to reach a selected button then double click on that
Here's my script but its not working:
WinActivate("Policy Decisions -- Webpage Dialog","")
Sleep(3000)
Send("{TAB}")
Send("{TAB}")
Send("{TAB}") // at this point its working according to my need but double click is not working
Mouseclick("Left",510, 320, 2, 0)
-
By cruisepandey
Hi There !
I have a script here :
;Launch CMD
Run("C:\Windows\System32\cmd.exe")
sleep(2000)
$cmdHandle = WinActivate("C:\Windows\System32\cmd.exe")
Sleep(2000)
;Sending document
ControlSend($cmdHandle, "", "", "ftp" & @CRLF)
ControlSend($cmdHandle, "", "", "open" & @CRLF)
Sleep(2000)
ControlSend($cmdHandle, "", "", "first command" & @CRLF)
Sleep(2000)
ControlSend($cmdHandle, "", "", "second-coomand" & @CRLF)
first-command and second-command I can't provide cause it's internal. I have complied this .au3 file into an exe and it does the work. But I need to invoke this with Java. Java code I have tried is :
ProcessBuilder pb = new ProcessBuilder("C:\\Users\\username\\eclipse-workspace\\Examples\\src\\com\\own\\examples\\etc.exe");
pb.start();
Thread.sleep(5000);
Through java it just launches the cmd and nothing happens after that. Please help !!
-
By JLogan3o13
There are a number of posts on the forum regarding use of Selenium in AutoIt. I recently had a go at using the PowerShell Selenium module, and was amazed at how easy it is. Thought I would post an example here; if anyone is interested this could probably be incorporated into AutoIt code pretty easily.
Pre-Req - The true star of this script is the ChroPath extension, available for Edge, Chrome and FireFox. With it installed, you just click on the element, select Inspect, and then ChroPath generates the XPath to the element for you. Here is an example based on a simple form I created on one of my sites.
$myForm = Start-SeChrome -StartURL "http://logancomputerser.com/Appointment.html" -Maximized $firstName = Find-SeElement -Driver $myForm -Timeout 30 -XPath "//input[@id='formElement_First']" $lastName = Find-SeElement -Driver $myForm -Timeout 30 -XPath "//input[@id='formElement_Last']" $address = Find-SeElement -Driver $myForm -Timeout 30 -XPath "//input[@id='formElement_Street1']" $city = Find-SeElement -Driver $myForm -Timeout 30 -XPath "//input[@id='formElement_City']" $zip = Find-SeElement -Driver $myForm -Timeout 30 -XPath "//input[@id='formElement_Zip']" $state = Find-SeElement -Driver $myForm -Timeout 30 -XPath "//select[@id='formElement_State']" $phoneDay = Find-SeElement -Driver $myForm -Timeout 30 -XPath "//input[@id='formElement_DaytimePhone']" $phoneNight = Find-SeElement -Driver $myForm -Timeout 30 -XPath "//input[@id='formElement_EveningPhone']" $email = Find-SeElement -Driver $myForm -Timeout 30 -XPath "//input[@id='formElement_liamE']" $user = Find-SeElement -Driver $myForm -Timeout 30 -XPath "//input[@id='formElement_48564']" $pw = Find-SeElement -Driver $myForm -Timeout 30 -XPath "//input[@id='formElement_f403c']" $submit = Find-SeElement -Driver $myForm -Timeout 30 -XPath "//input[@id='wstForm_Contact_Submit']" $reset = Find-SeElement -Driver $myForm -Timeout 30 -XPath "//input[@id='wstForm_Contact_Reset']" Send-SeKeys -Element $firstName -Keys "Joe" Send-SeKeys -Element $lastName -Keys "Blow" Send-SeKeys -Element $address -Keys "111 S. Main St." Send-SeKeys -Element $city -Keys "AnyCity" Send-SeKeys -Element $zip -Keys "90210" Send-SeKeys -Element $state -Keys "CA" Send-SeKeys -Element $phoneDay -Keys "555.867.5309" Send-SeKeys -Element $phoneNight -Keys "555.888.1212" Send-SeKeys -Element $email -Keys "1Adam12@gmail.com" Send-SeKeys -Element $user -Keys "JBlow" Send-SeKeys -Element $pw -Keys "MyPassword" Start-Sleep 1 Invoke-SeClick -Element $submit Stop-SeDriver -Driver $myForm
As mentioned, this is just another way to skin the cat, but I found it a pretty fast way to initiate some easy testing in Selenium, and have used it a couple of times in projects now, both straight through PowerShell and wrapped in AutoIt.
-
By XaelloNegative
Hi team,
I have a "well-built" autoIt exe app. Its running smooth until I open another application that when I run through the window info tool, returns as "SunAwtFrame". After running said application, my "well-built" autoIt exe app ceases to run.
What seems to be the problem here and is there a possible turn around for it? Any suggestion or recommendation will be greatly appreciated. Thanks in advance.
~XN~
-
By ags911
I have a script that has to work on multiple resolutions but each resolution has slightly different co-ordinates due to automatic UI scaling. I have had to make separate files for each but would like to implement them all in one script. I have a similar program written for Java which uses else if statements to use different co-ordinates for each resolution after it has been detected. I'm not good with Java so I would like to implement this on AutoIt before later making a Java version.
This is a snippet of the autoit code I have.
ToolTip("1 - Search")
MouseClick("Left", @DesktopWidth *0.823, @DesktopHeight *0.925, 1, 25)
ToolTip("2 - Buy Now")
MouseClick("Left", @DesktopWidth *0.83, @DesktopHeight *0.798, 1, 27)
ToolTip("3 - OK")
MouseClick("Left", @DesktopWidth *0.555, @DesktopHeight *0.596, 1, 15)
ToolTip("4 - OK Clear Error")
MouseClick("Left", @DesktopWidth *0.49, @DesktopHeight *0.597, 1, 30)
ToolTip("5 - Back to Search")
MouseClick("Left", @DesktopWidth *0.161, @DesktopHeight *0.108, 1, 15)
This is a snippet of a java code I used.
Thanks.
private static void goToSearch(double maxX, double maxY, Robot bot) throws InterruptedException { int currentX = 0; int currentY = 0; if (maxX == 2650 && maxY == 1440) { currentX = 734; currentY = 1316; } else if (maxX == 1920 && maxY == 1200) { currentX = 551; currentY = 1096; } else if (maxX == 1920 && maxY == 1080) { currentX = 551; currentY = 1042; } else if (maxX == 1680 && maxY == 1050) { currentX = 482; currentY = 959; } else if (maxX == 1440 && maxY == 900) { currentX = 413; currentY = 822; } else if (maxX == 1366 && maxY == 768) { currentX = 392; currentY = 741; } else if (maxX == 1280 && maxY == 800) { currentX = 367; currentY = 731;
-