Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mouse actions are not working in winium desktop #55

Open
Harian opened this issue Sep 28, 2017 · 1 comment
Open

Mouse actions are not working in winium desktop #55

Harian opened this issue Sep 28, 2017 · 1 comment

Comments

@Harian
Copy link

Harian commented Sep 28, 2017

kindly help me on this

@SanjeevKumarmn
Copy link

you can try some of these examples and not sure if this can help -

private static Point getCenterPoint(WebElement element) {
    Dimension size = element.getSize();
    int halfWidth = size.getWidth() / 2;
    int halfHeight = size.getHeight() / 2;

    Point loc = element.getLocation();
    int posX = loc.getX() + halfWidth;
    int posY = loc.getY() + halfHeight;

    Point point = new Point(posX, posY);
    return point;
}

public Coordinates getCoordinates(WebElement element) {
Locatable locatable = (Locatable) element;
Coordinates coords = locatable.getCoordinates();
return coords;
}

final public Rectangle getRectangle(WebElement element) {
    if (element == null)
        return null;
    Rectangle box = new Rectangle(element.getLocation().x,
            element.getLocation().y, element.getSize().width,
            element.getSize().height);
    return box;
}

public void send_text_using_vbs(String text){
    Runtime rn=Runtime.getRuntime();
    String[] command = {"wscript.exe", System.getProperty("user.dir") + "\\send_text.vbs",text};
    try {
        driver.switchTo().activeElement();
        Process pr=rn.exec(command);
    } catch (IOException e) {
        e.printStackTrace();
    }
}

Actions action= new Actions(driver);
    action.contextClick(bond_issuance_window.findElement(By.id(DEALER_TABLE_HEADER_ID))).build().perform();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants