{"id":2101,"date":"2017-01-14T22:06:44","date_gmt":"2017-01-14T13:06:44","guid":{"rendered":"http:\/\/appsweets.net\/blog\/?p=2101"},"modified":"2017-01-14T22:06:44","modified_gmt":"2017-01-14T13:06:44","slug":"testing-with-selenium-javascript-binding-3","status":"publish","type":"post","link":"http:\/\/appsweets.net\/blog\/2017\/01\/14\/testing-with-selenium-javascript-binding-3\/","title":{"rendered":"Testing with selenium javascript binding #3"},"content":{"rendered":"<div class=\"856f7bdf6ce2541193600c6e03dd1a56\" data-index=\"1\" style=\"float: left; margin: 16px 16px 16px 0;\">\n<script type=\"text\/javascript\"><!--\r\ngoogle_ad_client = \"ca-pub-5825700137064158\";\r\n\/* 250sq, appsweets-blog *\/\r\ngoogle_ad_slot = \"4837931762\";\r\ngoogle_ad_width = 250;\r\ngoogle_ad_height = 250;\r\n\/\/-->\r\n<\/script>\r\n<script type=\"text\/javascript\"\r\nsrc=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\r\n<\/script>\n<\/div>\n<p>\u30c6\u30b9\u30c8\u3092\u958b\u59cb\u3057\u3066\u3082\u3001Chrome \u306f\u8d77\u52d5\u3059\u308b\u3082\u306e\u306e\u30c6\u30b9\u30c8\u30da\u30fc\u30b8\u3078\u306e\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u304c\u767a\u751f\u305b\u305a\u3001\u305d\u306e\u307e\u307e\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u3067\u5931\u6557\u3057\u3066\u3057\u307e\u3046\u3053\u3068\u304c\u305f\u307e\u306b\u3042\u308b\u3002\u3053\u308c\u306e\u539f\u56e0\u304c\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u3002\u3068\u308a\u3042\u3048\u305a\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3068\u3057\u3066\u306f &#8220;unable to discover open pages&#8221; \u3068\u3044\u3046\u3082\u306e\u304c\u8fd4\u3055\u308c\u308b\u3002<\/p>\n<p>\u539f\u56e0\u306f\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u3002\u30c6\u30b9\u30c8\u7528\u3068\u306f\u5225\u306e\u5e38\u7528\u306e Chrome \u3092\u8d77\u52d5\u3057\u3066\u3044\u308b\u72b6\u614b\u3067\u30c6\u30b9\u30c8\u3092\u958b\u59cb\u3059\u308b\u3068\u3001\u305d\u3046\u3044\u3046\u72b6\u6cc1\u304c\u767a\u751f\u3059\u308b\u3053\u3068\u304c\u3042\u308b\u304c\u3001\u3057\u306a\u3044\u3053\u3068\u3082\u3042\u308b\u3002\u5e38\u7528\u306e Chrome \u3092\u843d\u3068\u3057\u305f\u72b6\u614b\u3067\u3082\u767a\u751f\u3059\u308b\u3053\u3068\u304c\u3042\u308b\u3002\u307e\u305f youtube \u3068\u304b\u306e\u52d5\u753b\u3092\u518d\u751f\u4e2d\u3060\u3068\u767a\u751f\u3059\u308b\u78ba\u7387\u304c\u4e0a\u304c\u308b\u3088\u3046\u306a\u6c17\u304c\u3057\u306a\u3044\u3067\u3082\u306a\u3044\u3002\u8981\u3059\u308b\u306b chromedriver \u304c Chrome \u3092\u8d77\u52d5\u3059\u308b\u3082\u306e\u306e\u3001\u8907\u6570\u3042\u308b Chrome \u306e\u3046\u3061\u81ea\u5206\u304c\u8d77\u52d5\u3055\u305b\u305f\u3082\u306e\u3092\u898b\u5931\u3046\u3053\u3068\u304c\u3042\u308b\u3001\u3068\u3044\u3046\u3088\u3046\u306a\u611f\u3058\u306a\u306e\u3060\u304c\u2026\u2026\u305d\u3093\u306a\u308f\u3051\u3042\u308b\u304b\u3044\u306a\u3002<\/p>\n<p>\u4e0a\u8a18\u306e\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3067\u30b0\u30b0\u3063\u3066\u3082\u7279\u306b\u3053\u308c\u3060\u3068\u3044\u3046\u3082\u306e\u3082\u306a\u3044\u3002\u8b0e\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b Linux \u7248\u306e Chrome \u3067 UI \u306e\u30ed\u30b1\u30fc\u30eb\u3092\u4efb\u610f\u306e\u3082\u306e\u306b\u3059\u308b\u306b\u306f\u3001[cci]LANGUAGE=en google-chrome[\/cci] \u306a\u3069\u3068\u3059\u308b\u3002LANG \u3067\u3082 LC_ALL \u3067\u3082\u306a\u304f\u3001LANGUAGE\u3002\u307e\u305f\u3001[cci]&#8211;lang[\/cci] \u30b9\u30a4\u30c3\u30c1\u306f\u52b9\u304b\u306a\u3044\u3002<\/p>\n<p>\u3000\uff0a\u3000\uff0a\u3000\uff0a<\/p>\n<p>\u3068\u3044\u3046\u308f\u3051\u3067\u3001\u3068\u308a\u3042\u3048\u305a\u3059\u3079\u3066\u306e\u6a5f\u80fd\u30c6\u30b9\u30c8\u3092 java \u304b\u3089 javascript \u3078\u79fb\u690d\u3057\u305f\u3002\u75b2\u308c\u305f\u3002\u6b21\u306b\u3053\u308c\u3092 Windows \u4e0a\u306e Firefox \u306b\u3066\u901a\u3057\u3066\u30c6\u30b9\u30c8\u3059\u308b\u3002\u3068\u305d\u306e\u524d\u306b\u3001Linux \u4e0a\u3067\u3082\u52d5\u304b\u3057\u3066\u307f\u3088\u3046\u3002<\/p>\n<p>\u30ca\u30a6\u3044 Firefox \u3067 Selenium \u306e\u30c6\u30b9\u30c8\u3092\u3059\u308b\u306b\u306f\u3001<a href=\"https:\/\/github.com\/mozilla\/geckodriver\" target=\"_blank\">geckodriver<\/a> \u304c\u5fc5\u8981\u306a\u306e\u3067\u3001\u3053\u308c\u3092\u30d1\u30b9\u306e\u901a\u3063\u305f\u3068\u3053\u308d\u306b\u7f6e\u3044\u3066\u304a\u304f\u3002<\/p>\n<p><code lang=\"javascript\"><br \/>\nvar options = new firefox.Options();<br \/>\noptions.setProfile(profilePath);<br \/>\nresult = new webdriver.Builder()<br \/>\n      .withCapabilities(webdriver.Capabilities.firefox())<br \/>\n      .setFirefoxOptions(options)<br \/>\n      .build()<br \/>\n<\/code><br \/>\n\u3053\u3093\u306a\u611f\u3058\u3067\u8d77\u52d5\u3002\u3053\u308c\u306f\u65e2\u5b58\u306e\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u3092\u5229\u7528\u3059\u308b\u3088\u3046\u306a\u52d5\u4f5c\u3092\u610f\u56f3\u3057\u3066\u3044\u308b\u304c\u3001\u3069\u3046\u3082\u65e2\u5b58\u306e\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u3092 \/tmp \u3042\u305f\u308a\u306b\u307e\u308b\u3054\u3068\u30b3\u30d4\u30fc\u3057\u3066\u304b\u3089\u8d77\u52d5\u3059\u308b\u3088\u3046\u306a\u611f\u3058\u304c\u3059\u308b\u3002\u305d\u306e\u305f\u3081\u5b9f\u969b\u306b Firefox \u306e\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u8868\u793a\u3055\u308c\u308b\u307e\u3067\u306f\u7d50\u69cb\u5f85\u305f\u3055\u308c\u308b\u3002<\/p>\n<p>\u305d\u308c\u304b\u3089\u3001webdriver.actions().sendKeys().perform() \u304c<a href=\"https:\/\/github.com\/SeleniumHQ\/selenium\/issues\/2611\" target=\"_blank\">\u672a\u5b9f\u88c5<\/a>\u306a\u306e\u3060\u305d\u3046\u3067\u30a8\u30e9\u30fc\u306b\u306a\u308b\u3002\u305d\u306e\u4ee3\u308f\u308a WebElement#sendKeys() \u3092\u4f7f\u3046\u3002geckodriver \u81ea\u4f53\u304c\u65b0\u3057\u3044\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306a\u306e\u3067\u3001\u3059\u3079\u3066\u306e\u60f3\u5b9a\u3055\u308c\u305f\u6a5f\u80fd\u304c\u5b9f\u88c5\u3055\u308c\u308b\u307e\u3067\u306b\u306f\u3082\u3046\u3061\u3087\u3063\u3068\u304b\u304b\u308b\u96f0\u56f2\u6c17\u3002<\/p>\n<p>\u3000\uff0a\u3000\uff0a\u3000\uff0a<\/p>\n<p>\u7d50\u5c40\u306e\u3068\u3053\u308d wasavi \u3067\u30c6\u30b9\u30c8\u3059\u308b\u306b\u306f<\/p>\n<ol>\n<li>[cci]npm install -g selenium-webdriver[\/cci]<\/li>\n<li>[cci]npm install -g chromedriver geckodriver operadriver[\/cci]<\/li>\n<li>[cci]npm install -g mocha[\/cci]<\/li>\n<li>[cci]npm install[\/cci]<\/li>\n<\/ol>\n<p>\u3068\u5165\u308c\u3066\u3001[cci]make run-chrome[\/cci] \u3068\u3057\u3066\u3068\u308a\u3042\u3048\u305a\u30c6\u30b9\u30c8\u7528\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u3067\u3082\u3063\u3066\u8d77\u52d5\u3057\u3001\u958b\u767a\u8005\u30e2\u30fc\u30c9\u3067 wasavi \u3092\u7d44\u307f\u8fbc\u307f\u3001\u3064\u3044\u3067\u306b dropbox \u306a\u3069\u306b wasavi \u304b\u3089\u30a2\u30af\u30bb\u30b9\u3057\u3066\u8a8d\u8a3c\u3092\u5f97\u3066\u304a\u304d\u3001\u30d6\u30e9\u30a6\u30b6\u3092\u9589\u3058\u3066\u304b\u3089 [cci]make test-chrome[\/cci] \u3068\u3059\u308b\u2026\u2026\u3068\u3044\u3046\u611f\u3058\u3002\u305f\u3060\u3057 Firefox \u306b\u95a2\u3057\u3066\u306f\u3001\u904e\u53bb\u306e\u8a18\u4e8b\u306e\u901a\u308a\u30aa\u30f3\u30b6\u30d5\u30e9\u30a4\u3067 WebExtensions \u30d9\u30fc\u30b9\u306e\u62e1\u5f35\u3092\u767b\u9332\u3059\u308b\u306e\u304c\u73fe\u5728\u306e\u3068\u3053\u308d\u3067\u304d\u306a\u3044\u306e\u3067\u3001wasavi \u3092\u30d3\u30eb\u30c9\u3057\u305f\u4e0a\u3067 xpi \u3092\u767b\u9332\u3057\u305f\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u3092\u7528\u610f\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n<div class=\"856f7bdf6ce2541193600c6e03dd1a56\" data-index=\"1\" style=\"float: left; margin: 16px 16px 16px 0;\">\n<script type=\"text\/javascript\"><!--\r\ngoogle_ad_client = \"ca-pub-5825700137064158\";\r\n\/* 250sq, appsweets-blog *\/\r\ngoogle_ad_slot = \"4837931762\";\r\ngoogle_ad_width = 250;\r\ngoogle_ad_height = 250;\r\n\/\/-->\r\n<\/script>\r\n<script type=\"text\/javascript\"\r\nsrc=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\r\n<\/script>\n<\/div>\n\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>\u30c6\u30b9\u30c8\u3092\u958b\u59cb\u3057\u3066\u3082\u3001Chrome \u306f\u8d77\u52d5\u3059\u308b\u3082\u306e\u306e\u30c6\u30b9\u30c8\u30da\u30fc\u30b8\u3078\u306e\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u304c\u767a\u751f\u305b\u305a\u3001\u305d\u306e\u307e\u307e\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u3067\u5931\u6557\u3057\u3066\u3057\u307e\u3046\u3053\u3068\u304c\u305f\u307e\u306b\u3042\u308b\u3002\u3053\u308c\u306e\u539f\u56e0\u304c\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u3002\u3068\u308a\u3042\u3048\u305a\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3068\u3057\u3066\u306f &#8220;unable to discover open pages&#8221; \u3068\u3044\u3046\u3082\u306e\u304c\u8fd4\u3055\u308c\u308b\u3002 \u539f\u56e0\u306f\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u3002\u30c6\u30b9\u30c8\u7528\u3068\u306f\u5225\u306e\u5e38\u7528\u306e Chrome \u3092\u8d77\u52d5\u3057\u3066\u3044\u308b\u72b6\u614b\u3067\u30c6\u30b9\u30c8\u3092\u958b\u59cb\u3059\u308b\u3068\u3001\u305d\u3046\u3044\u3046\u72b6\u6cc1\u304c\u767a\u751f\u3059\u308b\u3053\u3068\u304c\u3042\u308b\u304c\u3001\u3057\u306a\u3044\u3053\u3068\u3082\u3042\u308b\u3002\u5e38\u7528\u306e Chrome \u3092\u843d\u3068\u3057\u305f\u72b6\u614b\u3067\u3082\u767a\u751f\u3059\u308b\u3053\u3068\u304c\u3042\u308b\u3002\u307e\u305f youtube \u3068\u304b\u306e\u52d5\u753b\u3092\u518d\u751f\u4e2d\u3060\u3068\u767a\u751f\u3059\u308b\u78ba\u7387\u304c\u4e0a\u304c\u308b\u3088\u3046\u306a\u6c17\u304c\u3057\u306a\u3044\u3067\u3082\u306a\u3044\u3002\u8981\u3059\u308b\u306b chromedriver \u304c Chrome \u3092\u8d77\u52d5\u3059\u308b\u3082\u306e\u306e\u3001\u8907\u6570\u3042\u308b Chrome \u306e\u3046\u3061\u81ea\u5206\u304c\u8d77\u52d5\u3055\u305b\u305f\u3082\u306e\u3092\u898b\u5931\u3046\u3053\u3068\u304c\u3042\u308b\u3001\u3068\u3044\u3046\u3088\u3046\u306a\u611f\u3058\u306a\u306e\u3060\u304c\u2026\u2026\u305d\u3093\u306a\u308f\u3051\u3042\u308b\u304b\u3044\u306a\u3002 \u4e0a\u8a18\u306e\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3067\u30b0\u30b0\u3063\u3066\u3082\u7279\u306b\u3053\u308c\u3060\u3068\u3044\u3046\u3082\u306e\u3082\u306a\u3044\u3002\u8b0e\u3002 \u3061\u306a\u307f\u306b Linux \u7248\u306e Chrome \u3067 UI \u306e\u30ed\u30b1\u30fc\u30eb\u3092\u4efb\u610f\u306e\u3082\u306e\u306b\u3059\u308b\u306b\u306f\u3001[cci]LANGUAGE=en google-chrome[\/cci] \u306a\u3069\u3068\u3059\u308b\u3002LANG \u3067\u3082 LC_ALL \u3067\u3082\u306a\u304f\u3001LANGUAGE\u3002\u307e\u305f\u3001[cci]&#8211;lang[\/cci] \u30b9\u30a4\u30c3\u30c1\u306f\u52b9\u304b\u306a\u3044\u3002 \u3000\uff0a\u3000\uff0a\u3000\uff0a \u3068\u3044\u3046\u308f\u3051\u3067\u3001\u3068\u308a\u3042\u3048\u305a\u3059\u3079\u3066\u306e\u6a5f\u80fd\u30c6\u30b9\u30c8\u3092 java \u304b\u3089 javascript &hellip; <a href=\"http:\/\/appsweets.net\/blog\/2017\/01\/14\/testing-with-selenium-javascript-binding-3\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[41,7,5,6,13,4],"class_list":["post-2101","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-chrome","tag-firefox","tag-javascript","tag-opera","tag-selenium","tag-wasavi"],"_links":{"self":[{"href":"http:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/posts\/2101","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/comments?post=2101"}],"version-history":[{"count":3,"href":"http:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/posts\/2101\/revisions"}],"predecessor-version":[{"id":2107,"href":"http:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/posts\/2101\/revisions\/2107"}],"wp:attachment":[{"href":"http:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/media?parent=2101"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/categories?post=2101"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/tags?post=2101"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}