Почему бы не попробовать Sikuli + Selenium WD + Java? Я не знаю sikuli, но видела статью, где таким способом кликали по ссылке внутри апплета -- Automate Applet window by Selenium 2 and Sikuli
Может получится отправить нужный текст в поле как-нибудь так:
Screen screen = new Screen();
Pattern img = Pattern("password.PNG");
WebDriver driver = new FirefoxDriver();
driver.get(URL);
//...
screen.type(img, "pass12345");
//...
Большое спасибо.
Написал как Вы посоветовали и все заработало
Вот такой код получился:
_____________________________________________________________________________________________________________________
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.firefox.internal.ProfilesIni;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.sikuli.script.*;
import java.util.concurrent.TimeUnit;
/**
* Created by alexml on 7/2/15.
*/
public class OTP {
public static void main(String[] args) throws FindFailed, InterruptedException {
ProfilesIni profile = new ProfilesIni();
FirefoxProfile myprofile = profile.getProfile("default");
WebDriver driver = new FirefoxDriver(myprofile);
driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
WebDriverWait wait = new WebDriverWait(driver, 30);
driver.navigate().to("https://ibank.otpbank.com.ua/");
wait.until(ExpectedConditions.elementToBeClickable(By.linkText("OTP online клиент (стандартный)")));
driver.findElement(By.linkText("OTP online клиент (стандартный)")).click();
wait.until(ExpectedConditions.elementToBeClickable(By.id("userLogin")));
driver.findElement(By.id("userLogin")).sendKeys("***");
driver.findElement(By.name("password")).sendKeys("***");
driver.findElement(By.id("key_password")).sendKeys("***");
driver.findElement(By.id("cert_path")).clear();
driver.findElement(By.id("cert_path")).sendKeys("***");
wait.until(ExpectedConditions.elementToBeClickable(By.id("enter_btn")));
driver.findElement(By.id("enter_btn")).click();
driver.switchTo().frame("menu");
wait.until(ExpectedConditions.elementToBeClickable(By.linkText("Операции с нац. валютой")));
driver.findElement(By.linkText("Операции с нац. валютой")).click();
driver.switchTo().defaultContent();
driver.switchTo().frame("topic");
wait.until(ExpectedConditions.elementToBeClickable(By.linkText("Создать документ")));
driver.findElement(By.linkText("Создать документ")).click();
wait.until(ExpectedConditions.elementToBeClickable(By.id("r_bank_id_control")));
driver.findElement(By.id("r_bank_id_control")).sendKeys("***");
driver.findElement(By.id("r_account_no")).sendKeys("***");
driver.findElement(By.id("r_descr")).sendKeys("***");
driver.findElement(By.id("r_idcode")).sendKeys("***");
driver.findElement(By.id("input_platpurp_code")).sendKeys("777");
driver.findElement(By.id("paymentpurpose")).sendKeys("***");
System.out.println("Test message" + "Object: ");
driver.findElement(By.id("summaVISUALi")).sendKeys("1");
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("$('#summaVISUALi').blur()");
wait.until(ExpectedConditions.elementToBeClickable(By.id("divAppletBtn")));
driver.findElement(By.id("divAppletBtn")).click();
Screen screen = new Screen();
screen.click("\\images\\password.png", 0);
screen.click("\\images\\password.png", 0);
screen.type("***");
screen.click("\\images\\send.png", 0);
Thread.sleep(1000);
wait.until(ExpectedConditions.elementToBeClickable(By.name("returnBtn")));
driver.switchTo().defaultContent();
driver.switchTo().frame("tops");
wait.until(ExpectedConditions.elementToBeClickable(By.name("reportBtn")));
driver.findElement(By.name("reportBtn")).click();
}
}
______________________________________________________________________________________________________________________________________
Правда по картинке приходиться кликать 2 раза, с одного раза бывает что Sikuli прамахиваеться и пишет с первую ячейку вместо второй.
Спасибо.