Watir-webdriver를 평가하여 (Watir의 브라우저 테스트를 위해) 브라우저 테스트 용으로 전환 할 수 있는지 결정할 필요가 있습니다. 핵심 작업 중 하나는 TinyMCE WYSIWYG 편집기와 상호 작용할 수있는 기능입니다. 응용 프로그램 TinyMCE를 사용하여 작업합니다. 나는 다음과 같은 솔루션 작업 얻을 관리했습니다 -watir-webdriver로 자동화 할 때 tinyMCE를 처리하는 방법은 무엇입니까?
@browser = Watir::Browser.new(:firefox)
@browser.goto("http://tinymce.moxiecode.com/tryit/full.php")
autoit = WIN32OLE.new('AutoITX3.Control')
autoit.WinActivate('TinyMCE - TinyMCE - Full featured example')
@browser.frame(:index, 0).body.click
autoit.Send("^a") # CTRL + a to select all
autoit.Send("{DEL}")
autoit.Send("Some new text")
이 방법의 단점, AutoIt을 사용하여, 나는 Windows 및 테스트 크로스 플랫폼을 실행할 수있는 능력에 따라 남아 있다는 것입니다을 관광 명소 중 하나입니다 of webdriver.
나는 같은 this thread에서 다음과 같은 몇 가지 webdriver 특정 솔루션을 발견 : 그것은 크로스 플랫폼을 작동 할 수 있지만 같은 기능이 Watir- 내에서 액세스 할 수 있는지 모르겠어요처럼 보인다String tinyMCEFrame = "TextEntryFrameName" // Replace as necessary
this.getDriver().switchTo().frame(tinyMCEFrame);
String entryText = "Testing entry\r\n";
this.getDriver().findElement(By.id("tinymce")).sendKeys(entryText);
//Replace ID as necessary
this.getDriver().switchTo().window(this.getDriver().getWindowHandle());
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
this.getDriver().findElement(By.partialLinkText("Done")).click();
webdriver. 제 질문은 특정 지원되는 브라우저 또는 운영 체제에 대한 종속성을 적용하지 않을 watir-webdriver를 사용하여 TinyMCE에 쓰고 삭제하고 제출하는 방법이 있습니까?
너무 moxiecode의 TinyMCE에 포럼에이 질문을 게시 고려 (이 매우 다릅니다) – Thariama