1

This is my code to automate the installation of an OpenText's product. But when the installer is loaded the Next button is not clicked.

When I checked the button with Au3Info_x64 and focused on the button, it didn't show any value of it. So I cant identify it.

Is there any way that it will automatically click the Next button so that I can automate this process?

public class NewCars {

  public static String jvmBitVersion()
  {
    return System.getProperty("sun.arch.data.model");
  }

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

    String jacobDllVersionToUse;
    if (jvmBitVersion().contains("32")){
    jacobDllVersionToUse = "jacob-1.18-x86.dll";
    }
    else {
    jacobDllVersionToUse = "jacob-1.18-x64.dll";
    }
    File file = new File("lib", jacobDllVersionToUse);
    System.setProperty(LibraryLoader.JACOB_DLL_PATH, file.getAbsolutePath());

    AutoItX x = new AutoItX(); 
    Runtime.getRuntime().exec("C:/Users/kjain/Desktop/Process Platform Install/OpenText Process Suite Platform 10.8/OpenText_CARS_2.5.exe");

    x.winWaitActive("OpenText CARS", "Next", 2000)strong text
    Thread.sleep(2000);
    x.send("{ENTER}");      

  }

}

closed as off-topic by Michael Durrant, alecxe Nov 25 '17 at 4:19

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about software development unrelated to testing are off-topic here, but can be asked on Stack Overflow." – Michael Durrant, alecxe
If this question can be reworded to fit the rules in the help center, please edit the question.

0

well if you insist of using AutoIT as your solution I can tell you that AutoIT doesn't recognize .Net objects well, there is a workaround to bypass this problem by using the windows messaging mechanism it is not the best solution but, I'm using it sometimes when needed:

#RequireAdmin

#include <SendMessage.au3>


Local Const $WM_MOUSEMOVE       = 0x0200
Local Const $WM_LBUTTONDOWN     = 0x0201; main mouse button
Local Const $WM_LBUTTONUP       = 0x0202; main mouse button
Local Const $WM_RBUTTONDOWN     = 0x0204; secondary mouse button
Local Const $WM_RBUTTONUP       = 0x0205; secondary mouse button
Local Const $WM_KEYDOWN         = 0x0100; Posted to the window with the keyboard focus when a nonsystem key is pressed. A nonsystem key is a key that is pressed when the ALT key is not pressed.
Local Const $WM_KEYUP           = 0x0101; Posted to the window with the keyboard focus when a nonsystem key is released. A nonsystem key is a key that is pressed when the ALT key is not pressed, or a keyboard key that is pressed when a window has the keyboard focus.



Local Const $VK_RIGHT           = 0x27; RIGHT ARROW  key
Local Const $VK_LEFT            = 0x25; LEFT  ARROW  key
Local Const $VK_DOWN            = 0x28; DOWN  ARROW  key
Local Const $VK_UP              = 0x26; UP    ARROW  key




; ===================================================================
; _MakeLong($a, $b)
;
; Concatenates two 16 bit values into one 32 bit value.
; Parameters:
;    $l - IN - The low order word (Lowest 16 bits)
;    $h - IN - The high order word (Highest 16 bits)
; Returns:
;    The two 16 bit values concatenated into a single 32 bit value.
; Notes:
;    Retrieve the values with HiWord and LoWord respectively.
; ===================================================================
Func _MakeLong($l, $h)
    Return BitOR(BitAnd($l, 0xFFFF), BitShift(BitAnd($h, 0xFFFF), -16))
 EndFunc  ; _MakeLong()

; ===================================================================
; ShadowLeftMouseClick($WinHwd, $x_Coord, $y_Coord)
;
; send mouse click to a window without changing the focus.
; Parameters:
;   $WinHwd - Window handler (can be retrieve using WinGetHandle() function)
;   $x_Coord - Decimal value of the X coordination within the window client area.
;   $y_Coord - Decimal value of the Y coordination within the window client area.
; Returns:
;    Null.
; Notes:
;   Working on Windows messaging concept.
; ===================================================================
Func ShadowLeftMouseClick($WinHwd, $x_Coord, $y_Coord)

   Local $lParam = _MakeLong($x_Coord, $y_Coord)
   _SendMessage($WinHwd,$WM_MOUSEMOVE,0,$lParam)
   _SendMessage($WinHwd,$WM_LBUTTONDOWN,0,$lParam)
   _SendMessage($WinHwd,$WM_LBUTTONUP,0,$lParam)

EndFunc

Not the answer you're looking for? Browse other questions tagged or ask your own question.