selenium-webdriver 3.5.0 → 4.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGES.md +246 -0
- package/LICENSE +1 -1
- package/NOTICE +1 -1
- package/README.md +40 -40
- package/chrome.js +118 -134
- package/edge.js +43 -117
- package/example/chrome_android.js +8 -9
- package/example/chrome_mobile_emulation.js +8 -9
- package/example/firefox_channels.js +23 -19
- package/example/google_search.js +3 -3
- package/example/google_search_test.js +38 -27
- package/example/{chrome_headless.js → headless.js} +15 -7
- package/example/logging.js +40 -7
- package/firefox.js +789 -0
- package/http/index.js +62 -9
- package/http/util.js +11 -6
- package/ie.js +83 -97
- package/index.js +198 -114
- package/io/exec.js +29 -15
- package/io/index.js +1 -1
- package/io/zip.js +1 -1
- package/lib/actions.js +68 -63
- package/lib/atoms/get-attribute.js +86 -0
- package/lib/atoms/is-displayed.js +76 -76
- package/lib/by.js +7 -4
- package/lib/capabilities.js +310 -210
- package/lib/command.js +27 -51
- package/lib/error.js +100 -41
- package/lib/http.js +161 -120
- package/lib/input.js +1044 -8
- package/lib/logging.js +1 -5
- package/lib/promise.js +222 -3331
- package/lib/proxy.js +134 -39
- package/lib/session.js +2 -2
- package/lib/symbols.js +0 -0
- package/lib/until.js +1 -1
- package/lib/webdriver.js +717 -953
- package/net/index.js +21 -25
- package/net/portprober.js +51 -68
- package/package.json +17 -12
- package/proxy.js +0 -0
- package/remote/index.js +63 -44
- package/safari.js +41 -128
- package/testing/index.js +386 -315
- package/.npmignore +0 -2
- package/example/async_await_test.js +0 -68
- package/example/google_search_generator.js +0 -50
- package/example/parallel_flows.js +0 -54
- package/firefox/binary.js +0 -344
- package/firefox/extension.js +0 -224
- package/firefox/index.js +0 -626
- package/firefox/profile.js +0 -394
- package/lib/README +0 -5
- package/lib/atoms/getAttribute.js +0 -9
- package/lib/devmode.js +0 -34
- package/lib/events.js +0 -210
- package/lib/firefox/webdriver.json +0 -70
- package/lib/test/build.js +0 -151
- package/lib/test/data/ClickTest_testClicksASurroundingStrongTag.html +0 -11
- package/lib/test/data/Page.aspx +0 -17
- package/lib/test/data/Page.aspx.cs +0 -22
- package/lib/test/data/Redirect.aspx +0 -11
- package/lib/test/data/Redirect.aspx.cs +0 -9
- package/lib/test/data/Settings.StyleCop +0 -759
- package/lib/test/data/Web.Config +0 -59
- package/lib/test/data/actualXhtmlPage.xhtml +0 -14
- package/lib/test/data/ajaxy_page.html +0 -81
- package/lib/test/data/alerts.html +0 -85
- package/lib/test/data/banner.gif +0 -0
- package/lib/test/data/beach.jpg +0 -0
- package/lib/test/data/blank.html +0 -1
- package/lib/test/data/bodyTypingTest.html +0 -41
- package/lib/test/data/booleanAttributes.html +0 -19
- package/lib/test/data/child/childPage.html +0 -8
- package/lib/test/data/child/grandchild/grandchildPage.html +0 -8
- package/lib/test/data/clickEventPage.html +0 -26
- package/lib/test/data/click_frames.html +0 -10
- package/lib/test/data/click_jacker.html +0 -38
- package/lib/test/data/click_out_of_bounds.html +0 -23
- package/lib/test/data/click_out_of_bounds_overflow.html +0 -85
- package/lib/test/data/click_rtl.html +0 -19
- package/lib/test/data/click_source.html +0 -18
- package/lib/test/data/click_tests/click_iframe.html +0 -6
- package/lib/test/data/click_tests/click_in_iframe.html +0 -8
- package/lib/test/data/click_tests/disabled_element.html +0 -12
- package/lib/test/data/click_tests/disappearing_element.html +0 -62
- package/lib/test/data/click_tests/google_map.html +0 -15
- package/lib/test/data/click_tests/google_map.png +0 -0
- package/lib/test/data/click_tests/html5_submit_buttons.html +0 -16
- package/lib/test/data/click_tests/issue5237.html +0 -9
- package/lib/test/data/click_tests/issue5237_frame.html +0 -1
- package/lib/test/data/click_tests/issue5237_target.html +0 -10
- package/lib/test/data/click_tests/link_that_wraps.html +0 -11
- package/lib/test/data/click_tests/mapped_page1.html +0 -9
- package/lib/test/data/click_tests/mapped_page2.html +0 -9
- package/lib/test/data/click_tests/mapped_page3.html +0 -9
- package/lib/test/data/click_tests/overlapping_elements.html +0 -70
- package/lib/test/data/click_tests/partially_overlapping_elements.html +0 -124
- package/lib/test/data/click_tests/span_that_wraps.html +0 -11
- package/lib/test/data/click_tests/submitted_page.html +0 -9
- package/lib/test/data/click_tests/wrapped_overlapping_elements.html +0 -13
- package/lib/test/data/click_too_big.html +0 -10
- package/lib/test/data/click_too_big_in_frame.html +0 -11
- package/lib/test/data/clicks.html +0 -35
- package/lib/test/data/closeable_window.html +0 -8
- package/lib/test/data/cn-test.html +0 -156
- package/lib/test/data/colorPage.html +0 -20
- package/lib/test/data/cookies.html +0 -30
- package/lib/test/data/coordinates_tests/element_in_frame.html +0 -9
- package/lib/test/data/coordinates_tests/element_in_nested_frame.html +0 -9
- package/lib/test/data/coordinates_tests/page_with_element_out_of_view.html +0 -11
- package/lib/test/data/coordinates_tests/page_with_empty_element.html +0 -10
- package/lib/test/data/coordinates_tests/page_with_fixed_element.html +0 -12
- package/lib/test/data/coordinates_tests/page_with_hidden_element.html +0 -10
- package/lib/test/data/coordinates_tests/page_with_invisible_element.html +0 -10
- package/lib/test/data/coordinates_tests/page_with_transparent_element.html +0 -10
- package/lib/test/data/coordinates_tests/simple_page.html +0 -10
- package/lib/test/data/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- package/lib/test/data/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- package/lib/test/data/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
- package/lib/test/data/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- package/lib/test/data/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- package/lib/test/data/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- package/lib/test/data/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- package/lib/test/data/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- package/lib/test/data/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- package/lib/test/data/css/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- package/lib/test/data/css/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
- package/lib/test/data/css/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
- package/lib/test/data/css/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
- package/lib/test/data/css/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
- package/lib/test/data/css/ui-lightness/jquery-ui-1.8.10.custom.css +0 -573
- package/lib/test/data/cssTransform.html +0 -61
- package/lib/test/data/cssTransform2.html +0 -20
- package/lib/test/data/document_write_in_onload.html +0 -13
- package/lib/test/data/dragAndDropInsideScrolledDiv.html +0 -67
- package/lib/test/data/dragAndDropTest.html +0 -102
- package/lib/test/data/dragDropOverflow.html +0 -104
- package/lib/test/data/draggableLists.html +0 -67
- package/lib/test/data/droppableItems.html +0 -65
- package/lib/test/data/dynamic.html +0 -39
- package/lib/test/data/dynamicallyModifiedPage.html +0 -42
- package/lib/test/data/errors.html +0 -15
- package/lib/test/data/firefox/jetpack-sample.xpi +0 -0
- package/lib/test/data/firefox/sample.xpi +0 -0
- package/lib/test/data/firefox/webextension.xpi +0 -0
- package/lib/test/data/fixedFooterNoScroll.html +0 -13
- package/lib/test/data/fixedFooterNoScrollQuirksMode.html +0 -12
- package/lib/test/data/formPage.html +0 -175
- package/lib/test/data/formSelectionPage.html +0 -46
- package/lib/test/data/form_handling_js_submit.html +0 -30
- package/lib/test/data/framePage3.html +0 -7
- package/lib/test/data/frameScrollChild.html +0 -26
- package/lib/test/data/frameScrollPage.html +0 -14
- package/lib/test/data/frameScrollParent.html +0 -11
- package/lib/test/data/frameWithAnimals.html +0 -11
- package/lib/test/data/frame_switching_tests/bug4876.html +0 -9
- package/lib/test/data/frame_switching_tests/bug4876_iframe.html +0 -9
- package/lib/test/data/frame_switching_tests/deletingFrame.html +0 -29
- package/lib/test/data/frame_switching_tests/deletingFrame_iframe.html +0 -8
- package/lib/test/data/frame_switching_tests/deletingFrame_iframe2.html +0 -7
- package/lib/test/data/frameset.html +0 -14
- package/lib/test/data/framesetPage2.html +0 -7
- package/lib/test/data/framesetPage3.html +0 -4
- package/lib/test/data/globalscope.html +0 -15
- package/lib/test/data/hidden.html +0 -5
- package/lib/test/data/hidden_partially.html +0 -45
- package/lib/test/data/html5/blue.jpg +0 -0
- package/lib/test/data/html5/database.js +0 -84
- package/lib/test/data/html5/geolocation.js +0 -18
- package/lib/test/data/html5/green.jpg +0 -0
- package/lib/test/data/html5/red.jpg +0 -0
- package/lib/test/data/html5/status.html +0 -1
- package/lib/test/data/html5/test.appcache +0 -11
- package/lib/test/data/html5/yellow.jpg +0 -0
- package/lib/test/data/html5Page.html +0 -32
- package/lib/test/data/icon.gif +0 -0
- package/lib/test/data/idElements.html +0 -2
- package/lib/test/data/iframeAtBottom.html +0 -15
- package/lib/test/data/iframeWithAlert.html +0 -1
- package/lib/test/data/iframeWithIframe.html +0 -1
- package/lib/test/data/iframes.html +0 -11
- package/lib/test/data/injectableContent.html +0 -22
- package/lib/test/data/javascriptEnhancedForm.html +0 -30
- package/lib/test/data/javascriptPage.html +0 -285
- package/lib/test/data/jquery-1.3.2.js +0 -4376
- package/lib/test/data/js/jquery-1.4.4.min.js +0 -167
- package/lib/test/data/js/jquery-ui-1.8.10.custom.min.js +0 -782
- package/lib/test/data/js/skins/lightgray/content.inline.min.css +0 -1
- package/lib/test/data/js/skins/lightgray/content.min.css +0 -1
- package/lib/test/data/js/skins/lightgray/fonts/readme.md +0 -1
- package/lib/test/data/js/skins/lightgray/fonts/tinymce-small.dev.svg +0 -175
- package/lib/test/data/js/skins/lightgray/fonts/tinymce-small.eot +0 -0
- package/lib/test/data/js/skins/lightgray/fonts/tinymce-small.svg +0 -62
- package/lib/test/data/js/skins/lightgray/fonts/tinymce-small.ttf +0 -0
- package/lib/test/data/js/skins/lightgray/fonts/tinymce-small.woff +0 -0
- package/lib/test/data/js/skins/lightgray/fonts/tinymce.dev.svg +0 -153
- package/lib/test/data/js/skins/lightgray/fonts/tinymce.eot +0 -0
- package/lib/test/data/js/skins/lightgray/fonts/tinymce.svg +0 -63
- package/lib/test/data/js/skins/lightgray/fonts/tinymce.ttf +0 -0
- package/lib/test/data/js/skins/lightgray/fonts/tinymce.woff +0 -0
- package/lib/test/data/js/skins/lightgray/img/anchor.gif +0 -0
- package/lib/test/data/js/skins/lightgray/img/loader.gif +0 -0
- package/lib/test/data/js/skins/lightgray/img/object.gif +0 -0
- package/lib/test/data/js/skins/lightgray/img/trans.gif +0 -0
- package/lib/test/data/js/skins/lightgray/skin.ie7.min.css +0 -1
- package/lib/test/data/js/skins/lightgray/skin.min.css +0 -1
- package/lib/test/data/js/themes/modern/theme.min.js +0 -1
- package/lib/test/data/js/tinymce.min.js +0 -10
- package/lib/test/data/key_logger.html +0 -34
- package/lib/test/data/key_tests/remove_on_keypress.html +0 -36
- package/lib/test/data/keyboard_shortcut.html +0 -36
- package/lib/test/data/linked_image.html +0 -16
- package/lib/test/data/locators_tests/boolean_attribute_selected.html +0 -13
- package/lib/test/data/locators_tests/boolean_attribute_selected_html4.html +0 -13
- package/lib/test/data/longContentPage.html +0 -55
- package/lib/test/data/macbeth.html +0 -5255
- package/lib/test/data/map.png +0 -0
- package/lib/test/data/map_visibility.html +0 -8
- package/lib/test/data/markerTransparent.png +0 -0
- package/lib/test/data/messages.html +0 -15
- package/lib/test/data/meta-redirect.html +0 -11
- package/lib/test/data/missedJsReference.html +0 -11
- package/lib/test/data/modal_dialogs/modal_1.html +0 -21
- package/lib/test/data/modal_dialogs/modal_2.html +0 -21
- package/lib/test/data/modal_dialogs/modal_3.html +0 -15
- package/lib/test/data/modal_dialogs/modalindex.html +0 -21
- package/lib/test/data/mouseOver.html +0 -17
- package/lib/test/data/mousePositionTracker.html +0 -33
- package/lib/test/data/nestedElements.html +0 -164
- package/lib/test/data/overflow/x_auto_y_auto.html +0 -30
- package/lib/test/data/overflow/x_auto_y_hidden.html +0 -30
- package/lib/test/data/overflow/x_auto_y_scroll.html +0 -30
- package/lib/test/data/overflow/x_hidden_y_auto.html +0 -30
- package/lib/test/data/overflow/x_hidden_y_hidden.html +0 -30
- package/lib/test/data/overflow/x_hidden_y_scroll.html +0 -30
- package/lib/test/data/overflow/x_scroll_y_auto.html +0 -30
- package/lib/test/data/overflow/x_scroll_y_hidden.html +0 -30
- package/lib/test/data/overflow/x_scroll_y_scroll.html +0 -30
- package/lib/test/data/overflow-body.html +0 -15
- package/lib/test/data/pageWithOnBeforeUnloadMessage.html +0 -20
- package/lib/test/data/pageWithOnLoad.html +0 -6
- package/lib/test/data/pageWithOnUnload.html +0 -6
- package/lib/test/data/page_with_link_to_slow_loading_page.html +0 -6
- package/lib/test/data/plain.txt +0 -1
- package/lib/test/data/proxy/page1.html +0 -20
- package/lib/test/data/proxy/page2.html +0 -24
- package/lib/test/data/proxy/page3.html +0 -5
- package/lib/test/data/readOnlyPage.html +0 -24
- package/lib/test/data/rectangles.html +0 -40
- package/lib/test/data/resultPage.html +0 -25
- package/lib/test/data/rich_text.html +0 -161
- package/lib/test/data/safari/frames_benchmark.html +0 -31
- package/lib/test/data/screen/screen.css +0 -19
- package/lib/test/data/screen/screen.html +0 -72
- package/lib/test/data/screen/screen.js +0 -7
- package/lib/test/data/screen/screen_frame1.html +0 -72
- package/lib/test/data/screen/screen_frame2.html +0 -72
- package/lib/test/data/screen/screen_frames.html +0 -11
- package/lib/test/data/screen/screen_iframes.html +0 -12
- package/lib/test/data/screen/screen_too_long.html +0 -68
- package/lib/test/data/screen/screen_x_long.html +0 -72
- package/lib/test/data/screen/screen_x_too_long.html +0 -72
- package/lib/test/data/screen/screen_y_long.html +0 -72
- package/lib/test/data/screen/screen_y_too_long.html +0 -72
- package/lib/test/data/scroll.html +0 -27
- package/lib/test/data/scroll2.html +0 -21
- package/lib/test/data/scroll3.html +0 -8
- package/lib/test/data/scroll4.html +0 -7
- package/lib/test/data/scroll5.html +0 -18
- package/lib/test/data/scrolling_tests/frame_with_height_above_200.html +0 -26
- package/lib/test/data/scrolling_tests/frame_with_height_above_2000.html +0 -26
- package/lib/test/data/scrolling_tests/frame_with_nested_scrolling_frame.html +0 -11
- package/lib/test/data/scrolling_tests/frame_with_nested_scrolling_frame_out_of_view.html +0 -12
- package/lib/test/data/scrolling_tests/frame_with_small_height.html +0 -10
- package/lib/test/data/scrolling_tests/page_with_double_overflow_auto.html +0 -19
- package/lib/test/data/scrolling_tests/page_with_frame_out_of_view.html +0 -12
- package/lib/test/data/scrolling_tests/page_with_nested_scrolling_frames.html +0 -11
- package/lib/test/data/scrolling_tests/page_with_nested_scrolling_frames_out_of_view.html +0 -12
- package/lib/test/data/scrolling_tests/page_with_non_scrolling_frame.html +0 -11
- package/lib/test/data/scrolling_tests/page_with_scrolling_frame.html +0 -11
- package/lib/test/data/scrolling_tests/page_with_scrolling_frame_out_of_view.html +0 -12
- package/lib/test/data/scrolling_tests/page_with_tall_frame.html +0 -11
- package/lib/test/data/scrolling_tests/page_with_y_overflow_auto.html +0 -14
- package/lib/test/data/scrolling_tests/target_page.html +0 -9
- package/lib/test/data/selectPage.html +0 -58
- package/lib/test/data/selectableItems.html +0 -65
- package/lib/test/data/sessionCookie.html +0 -21
- package/lib/test/data/sessionCookieDest.html +0 -34
- package/lib/test/data/simple.xml +0 -5
- package/lib/test/data/simpleTest.html +0 -98
- package/lib/test/data/single_text_input.html +0 -12
- package/lib/test/data/slowLoadingAlert.html +0 -10
- package/lib/test/data/slowLoadingResourcePage.html +0 -12
- package/lib/test/data/slow_loading_iframes.html +0 -14
- package/lib/test/data/styledPage.html +0 -28
- package/lib/test/data/svgPiechart.xhtml +0 -81
- package/lib/test/data/svgTest.svg +0 -4
- package/lib/test/data/tables.html +0 -36
- package/lib/test/data/tinymce.html +0 -10
- package/lib/test/data/transformable.xml +0 -11
- package/lib/test/data/transformable.xsl +0 -37
- package/lib/test/data/transparentUpload.html +0 -70
- package/lib/test/data/underscore.html +0 -9
- package/lib/test/data/unicode_ltr.html +0 -8
- package/lib/test/data/upload.html +0 -45
- package/lib/test/data/userDefinedProperty.html +0 -8
- package/lib/test/data/veryLargeCanvas.html +0 -81
- package/lib/test/data/visibility-css.html +0 -21
- package/lib/test/data/win32frameset.html +0 -8
- package/lib/test/data/window_switching_tests/page_with_frame.html +0 -12
- package/lib/test/data/window_switching_tests/simple_page.html +0 -9
- package/lib/test/data/xhtmlFormPage.xhtml +0 -17
- package/lib/test/data/xhtmlTest.html +0 -76
- package/lib/test/fileserver.js +0 -321
- package/lib/test/httpserver.js +0 -120
- package/lib/test/index.js +0 -270
- package/lib/test/promise.js +0 -79
- package/lib/test/resources.js +0 -44
- package/opera.js +0 -405
- package/phantomjs.js +0 -282
- package/test/actions_test.js +0 -52
- package/test/chrome/options_test.js +0 -227
- package/test/chrome/service_test.js +0 -45
- package/test/cookie_test.js +0 -214
- package/test/element_finding_test.js +0 -426
- package/test/execute_script_test.js +0 -350
- package/test/fingerprint_test.js +0 -62
- package/test/firefox/extension_test.js +0 -120
- package/test/firefox/firefox_test.js +0 -261
- package/test/firefox/profile_test.js +0 -140
- package/test/http/http_test.js +0 -223
- package/test/http/util_test.js +0 -178
- package/test/io/io_test.js +0 -360
- package/test/io/zip_test.js +0 -128
- package/test/lib/by_test.js +0 -160
- package/test/lib/capabilities_test.js +0 -111
- package/test/lib/error_test.js +0 -305
- package/test/lib/events_test.js +0 -177
- package/test/lib/http_test.js +0 -696
- package/test/lib/logging_test.js +0 -272
- package/test/lib/promise_aplus_test.js +0 -78
- package/test/lib/promise_error_test.js +0 -884
- package/test/lib/promise_flow_test.js +0 -2288
- package/test/lib/promise_generator_test.js +0 -310
- package/test/lib/promise_test.js +0 -1109
- package/test/lib/testutil.js +0 -90
- package/test/lib/until_test.js +0 -478
- package/test/lib/webdriver_test.js +0 -2311
- package/test/logging_test.js +0 -167
- package/test/net/index_test.js +0 -60
- package/test/net/portprober_test.js +0 -128
- package/test/page_loading_test.js +0 -166
- package/test/phantomjs/execute_phantomjs_test.js +0 -59
- package/test/proxy_test.js +0 -180
- package/test/rect_test.js +0 -60
- package/test/remote_test.js +0 -117
- package/test/safari_test.js +0 -108
- package/test/session_test.js +0 -99
- package/test/stale_element_test.js +0 -63
- package/test/tag_name_test.js +0 -36
- package/test/testing/assert_test.js +0 -373
- package/test/testing/index_test.js +0 -224
- package/test/upload_test.js +0 -86
- package/test/window_test.js +0 -161
- package/testing/assert.js +0 -378
package/lib/command.js
CHANGED
|
@@ -90,7 +90,6 @@ const Name = {
|
|
|
90
90
|
|
|
91
91
|
NEW_SESSION: 'newSession',
|
|
92
92
|
GET_SESSIONS: 'getSessions',
|
|
93
|
-
DESCRIBE_SESSION: 'getSessionCapabilities',
|
|
94
93
|
|
|
95
94
|
CLOSE: 'close',
|
|
96
95
|
QUIT: 'quit',
|
|
@@ -124,10 +123,16 @@ const Name = {
|
|
|
124
123
|
SET_WINDOW_POSITION: 'setWindowPosition',
|
|
125
124
|
GET_WINDOW_SIZE: 'getWindowSize',
|
|
126
125
|
SET_WINDOW_SIZE: 'setWindowSize',
|
|
126
|
+
GET_WINDOW_RECT: 'getWindowRect',
|
|
127
|
+
SET_WINDOW_RECT: 'setWindowRect',
|
|
127
128
|
MAXIMIZE_WINDOW: 'maximizeWindow',
|
|
129
|
+
MINIMIZE_WINDOW: 'minimizeWindow',
|
|
130
|
+
FULLSCREEN_WINDOW: 'fullscreenWindow',
|
|
128
131
|
|
|
129
132
|
SWITCH_TO_WINDOW: 'switchToWindow',
|
|
133
|
+
SWITCH_TO_NEW_WINDOW: 'newWindow',
|
|
130
134
|
SWITCH_TO_FRAME: 'switchToFrame',
|
|
135
|
+
SWITCH_TO_FRAME_PARENT: 'switchToFrameParent',
|
|
131
136
|
GET_PAGE_SOURCE: 'getPageSource',
|
|
132
137
|
GET_TITLE: 'getTitle',
|
|
133
138
|
|
|
@@ -141,14 +146,13 @@ const Name = {
|
|
|
141
146
|
IS_ELEMENT_DISPLAYED: 'isElementDisplayed',
|
|
142
147
|
GET_ELEMENT_LOCATION: 'getElementLocation',
|
|
143
148
|
GET_ELEMENT_LOCATION_IN_VIEW: 'getElementLocationOnceScrolledIntoView',
|
|
149
|
+
GET_ELEMENT_RECT: 'getElementRect',
|
|
144
150
|
GET_ELEMENT_SIZE: 'getElementSize',
|
|
145
151
|
GET_ELEMENT_ATTRIBUTE: 'getElementAttribute',
|
|
146
152
|
GET_ELEMENT_VALUE_OF_CSS_PROPERTY: 'getElementValueOfCssProperty',
|
|
147
|
-
ELEMENT_EQUALS: 'elementEquals',
|
|
148
153
|
|
|
149
154
|
SCREENSHOT: 'screenshot',
|
|
150
155
|
TAKE_ELEMENT_SCREENSHOT: 'takeElementScreenshot',
|
|
151
|
-
IMPLICITLY_WAIT: 'implicitlyWait',
|
|
152
156
|
SET_SCRIPT_TIMEOUT: 'setScriptTimeout',
|
|
153
157
|
|
|
154
158
|
GET_TIMEOUT: 'getTimeout',
|
|
@@ -158,66 +162,38 @@ const Name = {
|
|
|
158
162
|
DISMISS_ALERT: 'dismissAlert',
|
|
159
163
|
GET_ALERT_TEXT: 'getAlertText',
|
|
160
164
|
SET_ALERT_TEXT: 'setAlertValue',
|
|
161
|
-
SET_ALERT_CREDENTIALS: 'setAlertCredentials',
|
|
162
|
-
|
|
163
|
-
EXECUTE_SQL: 'executeSQL',
|
|
164
|
-
GET_LOCATION: 'getLocation',
|
|
165
|
-
SET_LOCATION: 'setLocation',
|
|
166
|
-
GET_APP_CACHE: 'getAppCache',
|
|
167
|
-
GET_APP_CACHE_STATUS: 'getStatus',
|
|
168
|
-
CLEAR_APP_CACHE: 'clearAppCache',
|
|
169
|
-
IS_BROWSER_ONLINE: 'isBrowserOnline',
|
|
170
|
-
SET_BROWSER_ONLINE: 'setBrowserOnline',
|
|
171
|
-
|
|
172
|
-
GET_LOCAL_STORAGE_ITEM: 'getLocalStorageItem',
|
|
173
|
-
GET_LOCAL_STORAGE_KEYS: 'getLocalStorageKeys',
|
|
174
|
-
SET_LOCAL_STORAGE_ITEM: 'setLocalStorageItem',
|
|
175
|
-
REMOVE_LOCAL_STORAGE_ITEM: 'removeLocalStorageItem',
|
|
176
|
-
CLEAR_LOCAL_STORAGE: 'clearLocalStorage',
|
|
177
|
-
GET_LOCAL_STORAGE_SIZE: 'getLocalStorageSize',
|
|
178
|
-
|
|
179
|
-
GET_SESSION_STORAGE_ITEM: 'getSessionStorageItem',
|
|
180
|
-
GET_SESSION_STORAGE_KEYS: 'getSessionStorageKey',
|
|
181
|
-
SET_SESSION_STORAGE_ITEM: 'setSessionStorageItem',
|
|
182
|
-
REMOVE_SESSION_STORAGE_ITEM: 'removeSessionStorageItem',
|
|
183
|
-
CLEAR_SESSION_STORAGE: 'clearSessionStorage',
|
|
184
|
-
GET_SESSION_STORAGE_SIZE: 'getSessionStorageSize',
|
|
185
|
-
|
|
186
|
-
SET_SCREEN_ORIENTATION: 'setScreenOrientation',
|
|
187
|
-
GET_SCREEN_ORIENTATION: 'getScreenOrientation',
|
|
188
|
-
|
|
189
|
-
// These belong to the Advanced user interactions - an element is
|
|
190
|
-
// optional for these commands.
|
|
191
|
-
CLICK: 'mouseClick',
|
|
192
|
-
DOUBLE_CLICK: 'mouseDoubleClick',
|
|
193
|
-
MOUSE_DOWN: 'mouseButtonDown',
|
|
194
|
-
MOUSE_UP: 'mouseButtonUp',
|
|
195
|
-
MOVE_TO: 'mouseMoveTo',
|
|
196
|
-
SEND_KEYS_TO_ACTIVE_ELEMENT: 'sendKeysToActiveElement',
|
|
197
|
-
|
|
198
|
-
// These belong to the Advanced Touch API
|
|
199
|
-
TOUCH_SINGLE_TAP: 'touchSingleTap',
|
|
200
|
-
TOUCH_DOWN: 'touchDown',
|
|
201
|
-
TOUCH_UP: 'touchUp',
|
|
202
|
-
TOUCH_MOVE: 'touchMove',
|
|
203
|
-
TOUCH_SCROLL: 'touchScroll',
|
|
204
|
-
TOUCH_DOUBLE_TAP: 'touchDoubleTap',
|
|
205
|
-
TOUCH_LONG_PRESS: 'touchLongPress',
|
|
206
|
-
TOUCH_FLICK: 'touchFlick',
|
|
207
165
|
|
|
208
166
|
GET_AVAILABLE_LOG_TYPES: 'getAvailableLogTypes',
|
|
209
167
|
GET_LOG: 'getLog',
|
|
210
168
|
GET_SESSION_LOGS: 'getSessionLogs',
|
|
211
169
|
|
|
212
170
|
// Non-standard commands used by the standalone Selenium server.
|
|
213
|
-
UPLOAD_FILE: 'uploadFile'
|
|
171
|
+
UPLOAD_FILE: 'uploadFile',
|
|
172
|
+
|
|
173
|
+
ACTIONS: 'actions',
|
|
174
|
+
CLEAR_ACTIONS: 'clearActions',
|
|
175
|
+
|
|
176
|
+
LEGACY_ACTION_CLICK: 'legacyAction:click',
|
|
177
|
+
LEGACY_ACTION_DOUBLE_CLICK: 'legacyAction:doubleclick',
|
|
178
|
+
LEGACY_ACTION_MOUSE_DOWN: 'legacyAction:mouseDown',
|
|
179
|
+
LEGACY_ACTION_MOUSE_UP: 'legacyAction:mouseUp',
|
|
180
|
+
LEGACY_ACTION_MOUSE_MOVE: 'legacyAction:mouseMove',
|
|
181
|
+
LEGACY_ACTION_SEND_KEYS: 'legacyAction:sendKeys',
|
|
182
|
+
LEGACY_ACTION_TOUCH_DOWN: 'legacyAction:touchDown',
|
|
183
|
+
LEGACY_ACTION_TOUCH_UP: 'legacyAction:touchUp',
|
|
184
|
+
LEGACY_ACTION_TOUCH_MOVE: 'legacyAction:touchMove',
|
|
185
|
+
LEGACY_ACTION_TOUCH_SCROLL: 'legacyAction:touchScroll',
|
|
186
|
+
LEGACY_ACTION_TOUCH_LONG_PRESS: 'legacyAction:touchLongPress',
|
|
187
|
+
LEGACY_ACTION_TOUCH_FLICK: 'legacyAction:touchFlick',
|
|
188
|
+
LEGACY_ACTION_TOUCH_SINGLE_TAP: 'legacyAction:singleTap',
|
|
189
|
+
LEGACY_ACTION_TOUCH_DOUBLE_TAP: 'legacyAction:doubleTap',
|
|
214
190
|
};
|
|
215
191
|
|
|
216
192
|
|
|
217
193
|
|
|
218
194
|
/**
|
|
219
195
|
* Handles the execution of WebDriver {@link Command commands}.
|
|
220
|
-
* @
|
|
196
|
+
* @record
|
|
221
197
|
*/
|
|
222
198
|
class Executor {
|
|
223
199
|
/**
|
package/lib/error.js
CHANGED
|
@@ -40,6 +40,19 @@ class WebDriverError extends Error {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
|
|
43
|
+
/**
|
|
44
|
+
* Indicates a {@linkplain ./webdriver.WebElement#click click command} could not
|
|
45
|
+
* completed because the click target is obscured by other elements on the
|
|
46
|
+
* page.
|
|
47
|
+
*/
|
|
48
|
+
class ElementClickInterceptedError extends WebDriverError {
|
|
49
|
+
/** @param {string=} opt_error the error message, if any. */
|
|
50
|
+
constructor(opt_error) {
|
|
51
|
+
super(opt_error);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
43
56
|
/**
|
|
44
57
|
* An attempt was made to select an element that cannot be selected.
|
|
45
58
|
*/
|
|
@@ -52,10 +65,24 @@ class ElementNotSelectableError extends WebDriverError {
|
|
|
52
65
|
|
|
53
66
|
|
|
54
67
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
68
|
+
* Indicates a command could not be completed because the target element is
|
|
69
|
+
* not pointer or keyboard interactable. This will often occur if an element
|
|
70
|
+
* is present in the DOM, but not rendered (i.e. its CSS style has
|
|
71
|
+
* "display: none").
|
|
57
72
|
*/
|
|
58
|
-
class
|
|
73
|
+
class ElementNotInteractableError extends WebDriverError {
|
|
74
|
+
/** @param {string=} opt_error the error message, if any. */
|
|
75
|
+
constructor(opt_error) {
|
|
76
|
+
super(opt_error);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Indicates a navigation event caused the browser to generate a certificate
|
|
83
|
+
* warning. This is usually caused by an expired or invalid TLS certificate.
|
|
84
|
+
*/
|
|
85
|
+
class InsecureCertificateError extends WebDriverError {
|
|
59
86
|
/** @param {string=} opt_error the error message, if any. */
|
|
60
87
|
constructor(opt_error) {
|
|
61
88
|
super(opt_error);
|
|
@@ -89,7 +116,7 @@ class InvalidCookieDomainError extends WebDriverError {
|
|
|
89
116
|
/**
|
|
90
117
|
* The coordinates provided to an interactions operation are invalid.
|
|
91
118
|
*/
|
|
92
|
-
class
|
|
119
|
+
class InvalidCoordinatesError extends WebDriverError {
|
|
93
120
|
/** @param {string=} opt_error the error message, if any. */
|
|
94
121
|
constructor(opt_error) {
|
|
95
122
|
super(opt_error);
|
|
@@ -166,6 +193,18 @@ class NoSuchAlertError extends WebDriverError {
|
|
|
166
193
|
}
|
|
167
194
|
|
|
168
195
|
|
|
196
|
+
/**
|
|
197
|
+
* Indicates a named cookie could not be found in the cookie jar for the
|
|
198
|
+
* currently selected document.
|
|
199
|
+
*/
|
|
200
|
+
class NoSuchCookieError extends WebDriverError {
|
|
201
|
+
/** @param {string=} opt_error the error message, if any. */
|
|
202
|
+
constructor(opt_error) {
|
|
203
|
+
super(opt_error);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
|
|
169
208
|
/**
|
|
170
209
|
* An element could not be located on the page using the given search
|
|
171
210
|
* parameters.
|
|
@@ -340,6 +379,7 @@ class UnsupportedOperationError extends WebDriverError {
|
|
|
340
379
|
*/
|
|
341
380
|
const ErrorCode = {
|
|
342
381
|
SUCCESS: 0,
|
|
382
|
+
NO_SUCH_SESSION: 6,
|
|
343
383
|
NO_SUCH_ELEMENT: 7,
|
|
344
384
|
NO_SUCH_FRAME: 8,
|
|
345
385
|
UNKNOWN_COMMAND: 9,
|
|
@@ -367,16 +407,21 @@ const ErrorCode = {
|
|
|
367
407
|
SQL_DATABASE_ERROR: 35,
|
|
368
408
|
INVALID_XPATH_SELECTOR: 51,
|
|
369
409
|
INVALID_XPATH_SELECTOR_RETURN_TYPE: 52,
|
|
410
|
+
ELEMENT_NOT_INTERACTABLE: 60,
|
|
411
|
+
INVALID_ARGUMENT: 61,
|
|
412
|
+
NO_SUCH_COOKIE: 62,
|
|
413
|
+
UNABLE_TO_CAPTURE_SCREEN: 63,
|
|
414
|
+
ELEMENT_CLICK_INTERCEPTED: 64,
|
|
370
415
|
METHOD_NOT_ALLOWED: 405
|
|
371
416
|
};
|
|
372
417
|
|
|
373
418
|
|
|
374
419
|
const LEGACY_ERROR_CODE_TO_TYPE = new Map([
|
|
420
|
+
[ErrorCode.NO_SUCH_SESSION, NoSuchSessionError],
|
|
375
421
|
[ErrorCode.NO_SUCH_ELEMENT, NoSuchElementError],
|
|
376
422
|
[ErrorCode.NO_SUCH_FRAME, NoSuchFrameError],
|
|
377
423
|
[ErrorCode.UNSUPPORTED_OPERATION, UnsupportedOperationError],
|
|
378
424
|
[ErrorCode.STALE_ELEMENT_REFERENCE, StaleElementReferenceError],
|
|
379
|
-
[ErrorCode.ELEMENT_NOT_VISIBLE, ElementNotVisibleError],
|
|
380
425
|
[ErrorCode.INVALID_ELEMENT_STATE, InvalidElementStateError],
|
|
381
426
|
[ErrorCode.UNKNOWN_ERROR, WebDriverError],
|
|
382
427
|
[ErrorCode.ELEMENT_NOT_SELECTABLE, ElementNotSelectableError],
|
|
@@ -389,28 +434,36 @@ const LEGACY_ERROR_CODE_TO_TYPE = new Map([
|
|
|
389
434
|
[ErrorCode.UNEXPECTED_ALERT_OPEN, UnexpectedAlertOpenError],
|
|
390
435
|
[ErrorCode.NO_SUCH_ALERT, NoSuchAlertError],
|
|
391
436
|
[ErrorCode.SCRIPT_TIMEOUT, ScriptTimeoutError],
|
|
392
|
-
[ErrorCode.INVALID_ELEMENT_COORDINATES,
|
|
437
|
+
[ErrorCode.INVALID_ELEMENT_COORDINATES, InvalidCoordinatesError],
|
|
393
438
|
[ErrorCode.INVALID_SELECTOR_ERROR, InvalidSelectorError],
|
|
394
439
|
[ErrorCode.SESSION_NOT_CREATED, SessionNotCreatedError],
|
|
395
440
|
[ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS, MoveTargetOutOfBoundsError],
|
|
396
441
|
[ErrorCode.INVALID_XPATH_SELECTOR, InvalidSelectorError],
|
|
397
442
|
[ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPE, InvalidSelectorError],
|
|
443
|
+
[ErrorCode.ELEMENT_NOT_INTERACTABLE, ElementNotInteractableError],
|
|
444
|
+
[ErrorCode.INVALID_ARGUMENT, InvalidArgumentError],
|
|
445
|
+
[ErrorCode.NO_SUCH_COOKIE, NoSuchCookieError],
|
|
446
|
+
[ErrorCode.UNABLE_TO_CAPTURE_SCREEN, UnableToCaptureScreenError],
|
|
447
|
+
[ErrorCode.ELEMENT_CLICK_INTERCEPTED, ElementClickInterceptedError],
|
|
398
448
|
[ErrorCode.METHOD_NOT_ALLOWED, UnsupportedOperationError]]);
|
|
399
449
|
|
|
400
450
|
|
|
401
451
|
const ERROR_CODE_TO_TYPE = new Map([
|
|
402
452
|
['unknown error', WebDriverError],
|
|
453
|
+
['element click intercepted', ElementClickInterceptedError],
|
|
454
|
+
['element not interactable', ElementNotInteractableError],
|
|
403
455
|
['element not selectable', ElementNotSelectableError],
|
|
404
|
-
['
|
|
456
|
+
['insecure certificate', InsecureCertificateError],
|
|
405
457
|
['invalid argument', InvalidArgumentError],
|
|
406
458
|
['invalid cookie domain', InvalidCookieDomainError],
|
|
407
|
-
['invalid
|
|
459
|
+
['invalid coordinates', InvalidCoordinatesError],
|
|
408
460
|
['invalid element state', InvalidElementStateError],
|
|
409
461
|
['invalid selector', InvalidSelectorError],
|
|
410
462
|
['invalid session id', NoSuchSessionError],
|
|
411
463
|
['javascript error', JavascriptError],
|
|
412
464
|
['move target out of bounds', MoveTargetOutOfBoundsError],
|
|
413
465
|
['no such alert', NoSuchAlertError],
|
|
466
|
+
['no such cookie', NoSuchCookieError],
|
|
414
467
|
['no such element', NoSuchElementError],
|
|
415
468
|
['no such frame', NoSuchFrameError],
|
|
416
469
|
['no such window', NoSuchWindowError],
|
|
@@ -495,8 +548,11 @@ function throwDecodedError(data) {
|
|
|
495
548
|
if (isErrorResponse(data)) {
|
|
496
549
|
let ctor = ERROR_CODE_TO_TYPE.get(data.error) || WebDriverError;
|
|
497
550
|
let err = new ctor(data.message);
|
|
551
|
+
// TODO(jleyba): remove whichever case is excluded from the final W3C spec.
|
|
498
552
|
if (typeof data.stacktrace === 'string') {
|
|
499
553
|
err.remoteStacktrace = data.stacktrace;
|
|
554
|
+
} else if (typeof data.stackTrace === 'string') {
|
|
555
|
+
err.remoteStacktrace = data.stackTrace;
|
|
500
556
|
}
|
|
501
557
|
throw err;
|
|
502
558
|
}
|
|
@@ -544,37 +600,40 @@ function checkLegacyResponse(responseObj) {
|
|
|
544
600
|
|
|
545
601
|
|
|
546
602
|
module.exports = {
|
|
547
|
-
ErrorCode
|
|
548
|
-
|
|
549
|
-
WebDriverError
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
603
|
+
ErrorCode,
|
|
604
|
+
|
|
605
|
+
WebDriverError,
|
|
606
|
+
ElementClickInterceptedError,
|
|
607
|
+
ElementNotInteractableError,
|
|
608
|
+
ElementNotSelectableError,
|
|
609
|
+
InsecureCertificateError,
|
|
610
|
+
InvalidArgumentError,
|
|
611
|
+
InvalidCookieDomainError,
|
|
612
|
+
InvalidCoordinatesError,
|
|
613
|
+
InvalidElementStateError,
|
|
614
|
+
InvalidSelectorError,
|
|
615
|
+
JavascriptError,
|
|
616
|
+
MoveTargetOutOfBoundsError,
|
|
617
|
+
NoSuchAlertError,
|
|
618
|
+
NoSuchCookieError,
|
|
619
|
+
NoSuchElementError,
|
|
620
|
+
NoSuchFrameError,
|
|
621
|
+
NoSuchSessionError,
|
|
622
|
+
NoSuchWindowError,
|
|
623
|
+
ScriptTimeoutError,
|
|
624
|
+
SessionNotCreatedError,
|
|
625
|
+
StaleElementReferenceError,
|
|
626
|
+
TimeoutError,
|
|
627
|
+
UnableToSetCookieError,
|
|
628
|
+
UnableToCaptureScreenError,
|
|
629
|
+
UnexpectedAlertOpenError,
|
|
630
|
+
UnknownCommandError,
|
|
631
|
+
UnknownMethodError,
|
|
632
|
+
UnsupportedOperationError,
|
|
633
|
+
|
|
634
|
+
checkResponse,
|
|
635
|
+
checkLegacyResponse,
|
|
636
|
+
encodeError,
|
|
637
|
+
isErrorResponse,
|
|
638
|
+
throwDecodedError,
|
|
580
639
|
};
|