Skip to content

API library for talking with Jumoke Agents

Notifications You must be signed in to change notification settings

viastakhov/jumoke-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Jumoke-API

API library for talking with Jumoke Agents

Jumoke is a framework for testing distributed Desktop applications. Jumoke supports following wellknown libraries:

  • AutoIt X
  • SQL JDBC
  • SikuliX
  • WinAPI

Usage

  • Run Jumoke Agent on remote machine;
  • Type in your project following lines:
    Agent agent = new Agent("<remote machine host>", 8080);
      
    // Autoit
    AutoIt au = agent.getAutoIt();
    String txt = au.controlGetText("[X:3; W:430]", "", "[CLASS:Button; INSTANCE:1]");
    assert txt == "some text";
    
    // JDBC
    Jdbc dbc = agent.getJdbc("jdbc:sqlserver://<remote machine host>;user=sa;pasword=******;");
    String sqlStatement = " USE [SomeDB]; SELECT MAX(ID) AS ID FROM SomeTable";
    Document xmldoc = dbc.executeQuery(sqlStatement);
    XPathFactory xpathFactory = XPathFactory.newInstance();
    XPath xpath = xpathFactory.newXPath();
    XPathExpression expr =  xpath.compile("/Result/Row/ID/text()");
    NodeList nl = (NodeList) expr.evaluate(xmldoc, XPathConstants.NODESET);
    assert 1 == Integer.valueOf(nl.item(0).getNodeValue().trim());
    
    // Sikuli X
    Sikuli sx = ag.getSikuli();
    Screen scr = sx.getScreen(0);
    Pattern ptn = new Pattern("<some image>.png");
    scr.click(ptn);
    
    // WinAPI
    final UINT Msg = new UINT(0x018B);
    final WPARAM wParam = new WPARAM(0);
    final LPARAM lParam = new LPARAM(0);  
    WinApi wn = ag.getWinApi();
    int controlID = au.controlGetHandle("Title", "", "ListBox7");
    HWND hWnd = new HWND(Pointer.createConstant(controlID));
    int count = wn.sendMessage(hWnd, Msg, wParam, lParam).intValue();
    assert count == 5; 

License

Copyright © 2019 Vladimir Astakhov [viastakhov@mail.ru]

Distributed under the Eclipse Public License

Releases

No releases published

Packages

No packages published

Languages