Jump to content
Sign in to follow this  
Avinash Bhat

Enter value in the browse text box and press KEY Enter

Recommended Posts

Avinash Bhat

Hello,

 

Below is my class:

public static void main(String[] args) throws InterruptedException {

        //File file = new File("lib", "C:\\LSAutomation\\LSAutomationSuite\\lib\\jacob-1.17-M2-x64.dll");
        System.setProperty(LibraryLoader.JACOB_DLL_PATH, "C:\\LSAutomation\\LSAutomationSuite\\lib\\jacob-1.17-M2-x64.dll");

        AutoItX x = new AutoItX();
        //x.run("calc.exe");
        x.winActivate("Choose folder");
        x.winWaitActive("Choose folder");
        //Thread.sleep(1000);
        //x.controlClick("Fenofibrate", "Fenofibrate", "1");
        //x.controlClick("Select folder", "Select folder", "1");
        //x.ControlSetText("Choose folder", "", "Edit1", "asdf");
        x.send("\\\\10.31.85.60\\eSubmissions\\Fenofibrate");
        Thread.sleep(1000);    
        x.send("{ENTER}");
    }

 

Here it will focus on the choose filder folder and enter (\\10.31.85.60\\eSubmissions\\Fenofibrate) in the text box in the window applet.

 

Later i want to press ENTER from the keyboard by using x.send({ENTER}"); 

But it is taking {Enter} in the text box:

final result: \\10.31.85.60\\eSubmissions\\Fenofibrate{ENTER} --> What could be the problem here?

 

I dont want to enter the value - I just need to press enter after filling the text box.. How could i do this?

 

Regards,

Avinash

Share this post


Link to post
Share on other sites
Avinash Bhat

Yes John, I did x.send("{ENTER}");

But its not perssing enter key. Its typing {ENTER } in text box.

Share this post


Link to post
Share on other sites
Avinash Bhat

Nope its not working.

Attached the window - how it looks after doing this.

        System.setProperty(LibraryLoader.JACOB_DLL_PATH, "C:\\LSAutomation\\LSAutomationSuite\\lib\\jacob-1.17-M2-x64.dll");

        AutoItX x = new AutoItX();
        x.winActivate("Choose folder");
        x.winWaitActive("Choose folder");
        x.send("\\\\10.31.85.60\\eSubmissions\\Fenofibrate");
        Thread.sleep(1000);
        x.send("{ENTER}",true);

 

See the attached screen for the result

test.png

Share this post


Link to post
Share on other sites
Avinash Bhat

Yes i got it.. We have to pass False in the isRaw argument :) thanks :)

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×