Jump to content

Enter value in the browse text box and press KEY Enter


Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...