Keyboard frozen after script run --- need to press ctrl-alt-c
HI,
I have run a script using sikuli to lauch a command prompt and do some operations and close it.
Once the script execution is over keyboard will be freezed,if we press any keyboard key,it doesnt work.
If we manually press keyboard with hot key CTRL+ALT+C keys,then it will be fine.
Please do provide us the solution to it.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Chetan B
- Solved:
- Last query:
- Last reply:
Revision history for this message
|
#2 |
what version of SikuliX?
How do you open the command prompt?
Are you typing into the command prompt?
Revision history for this message
|
#4 |
Hi ,
Sorry i sent wrong code,please find correct code below:
package Devicetesting;
import org.apache.
import org.apache.
import org.apache.
import org.openqa.
import org.openqa.
import org.sikuli.
import org.sikuli.
import org.sikuli.
import org.sikuli.
import org.testng.
import org.testng.
import org.testng.
import javax.imageio.
import java.awt.*;
import java.awt.
import java.awt.
import java.io.*;
import java.text.
import java.util.Date;
public class SikuliCommand extends Base1 {
public static String line = null;
public static String actualresult = "";
public static String expectedresult =
"df090200000000
public static int i;
public static boolean flag = false;
@Test
public static void Sikuli() throws IOException,
InterruptedExce
try {
Screen screen = new Screen();
// Runtime.
// App app=new App("notepad.exe");
// App.open(
Robot robot = new Robot();
Pattern commandprompt1 = new
Pattern(
/*
Pattern commandprompt1 = new Pattern(
Pattern commandprompt2 = new Pattern(
Pattern commandprompt3= new Pattern(
Pattern commandprompt4 = new
Pattern(
Pattern commandprompt5= new
Pattern(
Pattern commandprompt6 = new
Pattern(
Pattern commandprompt7= new Pattern(
Pattern commandprompt8= new
Pattern(
Pattern commandprompt9= new Pattern(
// screen.
C:
Thread.
screen
*/
//Third command prompt
for (int i = 0; i <= 0; i++) {
// C:\Users\
Pattern(
Pattern(
Pattern(
Pattern(
Pattern(
Pattern(
Pattern(
Pattern(
Pattern(
Pattern(
// screen.
// screen.
int counter = 0;
}
if (flag == true) {
}
}
if (flag == false) {
SimpleDateForma
Robot()
Rectangle(
File("C:
Pattern(
Pattern(
// Runtime.
user32.
}
"3QAAAAAAAEERAA
byte[] decoded = Base64.
String Actualresult = Hex.encodeHexSt
// Reporter.
String expectedresult1 = expectedresult.
String expectedresult2 = expectedresult.
String expectedresult3 = expectedresult.
String Actualresult1 = Actualresult.
String Actualresult2 = Actualresult.
String Actualresult3 = Actualresult.
if (Actualresult1.
"").contains(
(Actualresult2.
"").contains(
(Actualresult3.
"").contains(
actual result");
System.
System.
System.
System.
Reporter.
Reporter.
Reporter.
Reporter.
SimpleDateForma
screen)
File("C:
} else {
expected result");
SimpleDateForma
screen)
File("C:
}
} catch (FileNotFoundEx
}
}
public static void main(String args[]) throws IOException,
InterruptedExce
}
}
Regards,
Chetan
Hi,
Yes I type in command
On Fri, Mar 15, 2019, 11:57 AM RaiMan <email address hidden>
wrote:
> Your question #679226 on Sikuli changed:
> https:/
>
> Status: Open => Needs information
>
> RaiMan requested more information:
> what version of SikuliX?
>
> How do you open the command prompt?
>
> Are you typing into the command prompt?
>
> --
> To answer this request for more information, you can either reply to
> this email or enter your reply at the following page:
> https:/
>
> You received this question notification because you asked the question.
>
Revision history for this message
|
#5 |
I open 3 command prompts using
Robot robot = new Robot();
do some operations and then open notepad and save some data and close all command prompt and notepad.
This is the complete process i do.
After the code execution is done ,when i type anything in my keyboard,none of the keys will work.
After press CTRL+ALT+C combination keyboard beomes normal.
Revision history for this message
|
#6 |
the only thing I can see, is that you are mixing the SikuliX AWT Robot (type()) with your own Robot instance.
Not sure what that might do.
Why don't you use the SikuliX features like
type("r", Key.WIN)
instead of
robot.
BTW: 1.1.2 is no longer supported for such special cases.
Use 1.1.4 snapshot
Revision history for this message
|
#7 |
If am using robot class of java to open run command and launch command
prompt
Using Sikuli i am not able to launch cmd.exe using App.open
On Fri, Mar 15, 2019 at 2:52 PM RaiMan <email address hidden>
wrote:
> Your question #679226 on Sikuli changed:
> https:/
>
> Status: Open => Answered
>
> RaiMan proposed the following answer:
> the only thing I can see, is that you are mixing the SikuliX AWT Robot
> (type()) with your own Robot instance.
>
> Not sure what that might do.
>
> Why don't you use the SikuliX features like
>
> type("r", Key.WIN)
>
> instead of
> robot.keyPress(
> robot.keyPress(
> robot.keyReleas
> robot.keyReleas
>
> BTW: 1.1.2 is no longer supported for such special cases.
> Use 1.1.4 snapshot
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https:/
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https:/
>
> You received this question notification because you asked the question.
>
Revision history for this message
|
#8 |
--- If am using robot class of java to open run command and launch command prompt
I have seen that of course.
That is why I asked:
Why don't you use the SikuliX features like
type("r", Key.WIN)
instead of
robot.
the idea is to get rid of your own Robot instance.
Revision history for this message
|
#9 |
Hi,
After removing robot class of java ,issue got solved.
Thanks a lot.
PLease let me know how to launch cmd.exe using sikuli command.
Regards,
Chetan
Revision history for this message
|
#10 |
until now I did not find an option to start a command prompt using App open.
I will make this a request bug (command prompt open, focus and close)
The easiest way:
type("r", Key.WIN)
wait(1)
type("cmd" + Key.ENTER)