In Chrome, using watir-webdriver, I click the button that opens the child browser window.
I do:
@browser.window(title: 'Child').use
I successfully interact with various elements in this child window.
Soon, an action was taken in this window, which, according to the site, was the "point" of opening the window in the first place. eg.
@browser.button(title: 'Button').click
When this action is performed, the child window closes.
When I tell watir-webdriver to return to using the parent window, however, I get an error:
@browser.window(title: 'Parent').use
I believe this is a Selenium / Watir-webdriver error, because the following code works:
@browser.window(title: 'Child').use
puts @browser.window(title: 'Parent').present?
@browser.window(title: 'Child').close
puts @browser.window(title: 'Parent').present?
@browser.window(title: 'Parent').use
The only difference is the action that causes the child window to close.
, watirspec , , , Windows watir-webdriver.
, , , :
require 'watir-webdriver'
@b = Watir::Browser.new :chrome
@b.goto 'ckeditor.com/demo#full'
@b.div(id: 'cke_editor1').link(title: 'Link').click
@b.link(title: 'Browse Server').wait_until_present
@b.link(title: 'Browse Server').click
@b.window(title: 'CKFinder').use {
@b.frame(title: 'CKFinder').link(id: 'r0').right_click
@b.frame(title: 'CKFinder').frame(id: 'cke_22_frame').wait_until_present
@b.frame(title: 'CKFinder').frame(id: 'cke_22_frame').link(id: 'cke_200').click
}
:
Selenium::WebDriver::Error::NoSuchWindowError: emptyScript execution failed;
The window could not be found
, !: -)
, : " , ?" : .
, , , , CKEditor, ( ). , , , , , , . , CKEditor. Capiche?