How to use firefox method of Selenium.WebDriver.Remote Package

Best Selenium code snippet using Selenium.WebDriver.Remote.firefox

Rakefile

Source:Rakefile Github

copy

Full Screen

...25task :chrome => [:'webdriver-chrome']26task :common => [:'webdriver-common']27task :htmlunit => [:'webdriver-htmlunit']28task :ie => [:'webdriver-ie']29task :firefox => [:'webdriver-firefox']30task :jobbie => [:ie]31task :jsapi => :'webdriver-jsapi'32task :remote => [:remote_common, :remote_server, :remote_client]33task :remote_common => [:'webdriver-remote-common']34task :remote_client => [:'webdriver-remote-client']35task :remote_server => [:'webdriver-remote-server']36task :selenium => [:'webdriver-selenium']37task :support => [:'webdriver-support']38task :iphone_client => [:'webdriver-iphone-client']39task :iphone => [:iphone_server, :iphone_client]4041task :test_common => [:'webdriver-common-test']42task :test_chrome => [:'webdriver-chrome-test']43task :test_htmlunit => [:'webdriver-htmlunit-test']44task :test_ie => [:'webdriver-ie-test']45task :test_jobbie => [:test_ie]46task :test_jsapi => :'webdriver-jsapi-test'47task :test_firefox => [:'webdriver-firefox-test']48task :test_remote => [:'webdriver-selenium-server-test']49task :test_selenium => [:'webdriver-selenium-server-test', :'webdriver-selenium-test', :'webdriver-selenese-test']50task :test_support => [:'webdriver-support-test']51task :test_iphone_client => [:'webdriver-iphone-client-test']52task :test_iphone => [:test_iphone_server, :test_iphone_client]5354task :test_core => [:'test_core_firefox']55if (windows?)56 task :test_core => [:'test_core_ie']57end5859task :build => [:all, :iphone, :remote, :selenium]60task :test => [61 :test_htmlunit,62 :test_firefox,63 :test_ie,64 :test_support,65 :test_chrome,66 :test_remote,67 :test_selenium,68 :test_core69 ]7071task :clean do72 rm_rf 'build/', :verbose => false73 rm_rf 'iphone/build/', :verbose => false74end7576java_jar(:name => "webdriver-chrome",77 :srcs => [ "chrome/src/java/**/*.java" ],78 :deps => [79 :common,80 :remote_client,81 :chrome_extension,82 "remote/common/lib/runtime/*.jar"83 ],84 :resources => [ :'chrome_extension' ])8586java_test(:name => "webdriver-chrome-test",87 :srcs => [ "chrome/test/java/**/*.java" ],88 :deps => [89 :chrome,90 :'webdriver-remote-common-test'91 ])9293java_jar(:name => 'webdriver-common',94 :srcs => [ 'common/src/java/**/*.java' ])9596java_jar(:name => 'webdriver-common-test',97 :srcs => [ "common/test/java/**/*.java" ],98 :resources => [ "common/test/java/org/openqa/selenium/messages.properties" => "org/openqa/selenium/messages.properties" ],99 :deps => [100 :'webdriver-common',101 "common/lib/buildtime/*.jar"102 ])103104java_jar(:name => 'webdriver-htmlunit',105 :srcs => [ 'htmlunit/src/java/**/*.java'],106 :deps => [107 :'webdriver-common',108 'htmlunit/lib/runtime/*.jar'109 ])110111java_test(:name => 'webdriver-htmlunit-test',112 :srcs => [ "htmlunit/test/java/**/*.java" ],113 :deps => [114 :htmlunit,115 :'webdriver-common-test',116 ])117118dll(:name => "ie_win32_dll",119 :src => [ "common/src/cpp/webdriver-interactions/**/*", "jobbie/src/cpp/InternetExplorerDriver/**/*" ],120 :solution => "WebDriver.sln",121 :out => "Win32/Release/InternetExplorerDriver.dll",122 :prebuilt => "jobbie/prebuilt")123124dll(:name => "ie_x64_dll",125 :src => [ "common/src/cpp/webdriver-interactions/**/*", "jobbie/src/cpp/InternetExplorerDriver/**/*" ],126 :solution => "WebDriver.sln",127 :out => "x64/Release/InternetExplorerDriver.dll",128 :prebuilt => "jobbie/prebuilt")129130dotnet_library(:name => "build/Win32/Release/WebDriver.Common.dll",131 :srcs => [ "common/src/csharp/**/*.cs" ],132 :solution => "WebDriver.sln",133 :project => "webdriver-common",134 :arch => "Win32",135 :prebuilt => "common/prebuilt")136137dotnet_library(:name => "build/x64/Release/WebDriver.Common.dll",138 :srcs => [ "common/src/csharp/**/*.cs" ],139 :solution => "WebDriver.sln",140 :project => "webdriver-common",141 :arch => "x64",142 :prebuilt => "common/prebuilt")143144dotnet_library(:name => "build/Win32/Release/webdriver-common-test.dll",145 :srcs => [ "common/test/csharp/**/*.cs" ],146 :solution => "WebDriver.sln",147 :project => "webdriver-common-test",148 :arch => "Win32",149 :prebuilt => "common/prebuilt")150151dotnet_library(:name => "build/x64/Release/webdriver-common-test.dll",152 :srcs => [ "common/test/csharp/**/*.cs" ],153 :solution => "WebDriver.sln",154 :project => "webdriver-common-test",155 :arch => "x64",156 :prebuilt => "common/prebuilt")157158dotnet_library(:name => "build/Win32/Release/WebDriver.Ie.dll",159 :srcs => [ "jobbie/src/csharp/**/*.cs" ],160 :solution => "WebDriver.sln",161 :project => "webdriver-ie",162 :arch => "Win32",163 :prebuilt => "jobbie/prebuilt")164165dotnet_library(:name => "build/x64/Release/WebDriver.Ie.dll",166 :srcs => [ "jobbie/src/csharp/**/*.cs" ],167 :solution => "WebDriver.sln",168 :project => "webdriver-ie",169 :arch => "x64",170 :prebuilt => "jobbie/prebuilt")171172dotnet_library(:name => "build/Win32/Release/webdriver-ie-test.dll",173 :srcs => [ "jobbie/test/csharp/**/*.cs" ],174 :solution => "WebDriver.sln",175 :project => "webdriver-ie-test",176 :arch => "Win32",177 :prebuilt => "jobbie/prebuilt")178179dotnet_library(:name => "build/x64/Release/webdriver-ie-test.dll",180 :srcs => [ "jobbie/test/csharp/**/*.cs" ],181 :solution => "WebDriver.sln",182 :project => "webdriver-ie-test",183 :arch => "x64",184 :prebuilt => "jobbie/prebuilt")185dotnet_library(:name => "build/Win32/Release/WebDriver.Firefox.dll",186 :srcs => [ "firefox/src/csharp/**/*.cs" ],187 :solution => "WebDriver.sln",188 :project => "webdriver-firefox",189 :arch => "Win32",190 :prebuilt => "firefox/prebuilt")191192dotnet_library(:name => "build/x64/Release/WebDriver.Firefox.dll",193 :srcs => [ "firefox/src/csharp/**/*.cs" ],194 :solution => "WebDriver.sln",195 :project => "webdriver-firefox",196 :arch => "x64",197 :prebuilt => "firefox/prebuilt")198199dotnet_library(:name => "build/Win32/Release/webdriver-firefox-test.dll",200 :srcs => [ "firefox/test/csharp/**/*.cs" ],201 :solution => "WebDriver.sln",202 :project => "webdriver-firefox-test",203 :arch => "Win32",204 :prebuilt => "firefox/prebuilt")205206dotnet_library(:name => "build/x64/Release/webdriver-firefox-test.dll",207 :srcs => [ "firefox/test/csharp/**/*.cs" ],208 :solution => "WebDriver.sln",209 :project => "webdriver-firefox-test",210 :arch => "x64",211 :prebuilt => "firefox/prebuilt")212dotnet_library(:name => "build/Win32/Release/WebDriver.Remote.dll",213 :srcs => [ "remote/client/src/csharp/**/*.cs" ],214 :solution => "WebDriver.sln",215 :project => "webdriver-remote",216 :arch => "Win32")217218dotnet_library(:name => "build/x64/Release/WebDriver.Remote.dll",219 :srcs => [ "remote/client/src/csharp/**/*.cs" ],220 :solution => "WebDriver.sln",221 :project => "webdriver-remote",222 :arch => "x64")223224dotnet_library(:name => "build/Win32/Release/webdriver-remote-test.dll",225 :srcs => [ "remote/client/test/csharp/**/*.cs" ],226 :solution => "WebDriver.sln",227 :project => "webdriver-remote-test",228 :arch => "Win32")229230dotnet_library(:name => "build/x64/Release/webdriver-remote-test.dll",231 :srcs => [ "remote/client/test/csharp/**/*.cs" ],232 :solution => "WebDriver.sln",233 :project => "webdriver-remote-test",234 :arch => "x64")235236task :dotnet => [ :'build/x64/Release/webdriver-ie-test.dll', :'build/Win32/Release/webdriver-ie-test.dll',237 :'build/x64/Release/Webdriver.Ie.dll', :'build/Win32/Release/Webdriver.Ie.dll',238 :'build/x64/Release/webdriver-firefox-test.dll', :'build/Win32/Release/webdriver-firefox-test.dll',239 :'build/x64/Release/Webdriver.Firefox.dll', :'build/Win32/Release/Webdriver.Firefox.dll',240 :'build/x64/Release/webdriver-remote-test.dll', :'build/Win32/Release/webdriver-remote-test.dll',241 :'build/x64/Release/Webdriver.Remote.dll', :'build/Win32/Release/Webdriver.Remote.dll',242 :'build/x64/Release/webdriver-common-test.dll', :'build/Win32/Release/webdriver-common-test.dll',243 :'build/x64/Release/Webdriver.Common.dll', :'build/Win32/Release/Webdriver.Common.dll',244 :ie_win32_dll, :ie_x64_dll ]245246# Generate a C++ Header file for mapping between magic numbers and #defines247# in the C++ code.248ie_generate_type_mapping(:name => "ie_result_type_cpp",249 :src => "jobbie/src/common/result_types.txt",250 :type => "cpp",251 :out => "cpp/InternetExplorerDriver/IEReturnTypes.h")252253# Generate a Java class for mapping between magic numbers and Java static254# class members describing them.255ie_generate_type_mapping(:name => "ie_result_type_java",256 :src => "jobbie/src/common/result_types.txt",257 :type => "java",258 :out => "java/org/openqa/selenium/ie/IeReturnTypes.java")259260java_jar(:name => "webdriver-ie",261 :srcs => [ "jobbie/src/java/**/*.java" ],262 :deps => [263 :'webdriver-common',264 "jobbie/lib/runtime/*.jar",265 :ie_result_type_java,266 :ie_result_type_cpp267 ],268 :resources => [269 {:ie_win32_dll => "x86/InternetExplorerDriver.dll"},270 {:ie_x64_dll => "amd64/InternetExplorerDriver.dll"},271 ])272273java_test(:name => "webdriver-ie-test",274 :srcs => [ "jobbie/test/java/**/*.java" ],275 :deps => [276 :ie,277 :test_common278 ],279 :run => windows?)280281xpt(:name => "events_xpt",282 :src => [ "firefox/src/cpp/webdriver-firefox/nsINativeEvents.idl" ],283 :prebuilt => "firefox/prebuilt",284 :out => "nsINativeEvents.xpt")285286xpt(:name => "responseHandler_xpt",287 :src => [ "firefox/src/extension/idl/nsIResponseHandler.idl" ],288 :prebuilt => "firefox/prebuilt",289 :out => "nsIResponseHandler.xpt")290291xpt(:name => "commandProcessor_xpt",292 :src => [ "firefox/src/extension/idl/nsICommandProcessor.idl" ],293 :deps => [ :responseHandler_xpt ],294 :prebuilt => "firefox/prebuilt",295 :out => "nsICommandProcessor.xpt")296297xpi(:name => "firefox_xpi",298 :srcs => [ "firefox/src/extension/**" ],299 :deps => [300 :firefox_dll,301 :libwebdriver_firefox,302 ],303 :resources => [304 { "firefox/src/extension/components/*.js" => "components/" },305 { "common/src/js/extension/*.js" => "content/" },306 { :commandProcessor_xpt => "components/" },307 { :events_xpt => "components/" },308 { :responseHandler_xpt => "components/" },309 { :firefox_dll => "platform/WINNT_x86-msvc/components/webdriver-firefox.dll" },310 { :libwebdriver_firefox_so => "platform/Linux_x86-gcc3/components/libwebdriver-firefox.so" },311 { :libwebdriver_firefox_so64 => "platform/Linux_x86_64-gcc3/components/libwebdriver-firefox.so" },312 ],313 :out => "webdriver-extension.zip")314315dll(:name => "firefox_dll",316 :src => [ "common/src/cpp/webdriver-interactions/**/*", "jobbie/src/cpp/webdriver-firefox/**/*" ],317 :solution => "WebDriver.sln",318 :out => "Win32/Release/webdriver-firefox.dll",319 :deps => [ 320 :events_xpt,321 ],322 :prebuilt => "firefox/prebuilt")323324dll(:name => "libnoblur_so_64",325 :src => FileList['firefox/src/cpp/linux-specific/*.c'],326 :arch => "amd64",327 :prebuilt => "firefox/prebuilt",328 :out => "linux64/Release/x_ignore_nofocus.so")329330dll(:name => "libnoblur_so",331 :src => FileList['firefox/src/cpp/linux-specific/*.c'],332 :arch => "i386",333 :prebuilt => "firefox/prebuilt",334 :out => "linux/Release/x_ignore_nofocus.so")335336task :libnoblur => [:libnoblur_so, :libnoblur_so_64]337338gecko_sdk = "third_party/gecko-1.9.0.11/linux/"339340dll(:name => "libwebdriver_firefox_so",341 :src => FileList.new('common/src/cpp/webdriver-interactions/*_linux.cpp') +342 FileList.new('firefox/src/cpp/webdriver-firefox/*.cpp'),343 :arch => "i386",344 :args => " -DXPCOM_GLUE -DXPCOM_GLUE_USE_NSPR -I common/src/cpp/webdriver-interactions -I #{gecko_sdk}include -I /usr/include/nspr " + "`pkg-config gtk+-2.0 --cflags`",345 :link_args => "-fno-rtti -fno-exceptions -shared -fPIC -L#{gecko_sdk}lib -L#{gecko_sdk}bin -Wl,-rpath-link,#{gecko_sdk}bin -lxpcomglue_s -lxpcom -lnspr4 -lrt ",346 :prebuilt => "firefox/prebuilt",347 :out => "linux/Release/libwebdriver-firefox.so")348349# There is no official 64 bit gecko SDK. Fall back to trying to use the one on 350# system, but be ready for this to fail. I have a Ubuntu machine, so that's 351# what I'm basing this on. I understand that's a Bad Idea352353gecko_devels = FileList.new("/usr/lib/xulrunner-devel-1.9.*/sdk")354local_gecko = gecko_devels.empty? ? "" : gecko_devels.to_a[0] + "/" 355356dll(:name => "libwebdriver_firefox_so64",357 :src => FileList.new('common/src/cpp/webdriver-interactions/*_linux.cpp') + FileList.new('firefox/src/cpp/webdriver-firefox/native_events.cpp'),358 :arch => "amd64",359 :args => " -DXPCOM_GLUE -DXPCOM_GLUE_USE_NSPR -fPIC -fshort-wchar -I common/src/cpp/webdriver-interactions -I #{local_gecko}include -I /usr/include/nspr `pkg-config gtk+-2.0 --cflags` ",360 :link_args => "-Wall -Os -L#{local_gecko}lib -L#{local_gecko}bin -Wl,-rpath-link,#{local_gecko}bin -lxpcomglue_s -lxpcom -lnspr4 -lrt `pkg-config gtk+-2.0 --libs` -fno-rtti -fno-exceptions -shared -fPIC",361 :prebuilt => "firefox/prebuilt",362 :out => "linux64/Release/libwebdriver-firefox.so")363364task :libwebdriver_firefox => [:libwebdriver_firefox_so, :libwebdriver_firefox_so64]365366java_jar(:name => "webdriver-firefox",367 :srcs => [ "firefox/src/java/**/*.java" ],368 :deps => [369 :common,370 :firefox_xpi,371 :libnoblur,372 "firefox/lib/runtime/*.jar"373 ],374 :resources => [ 375 :firefox_xpi,376 { "linux/Release/x_ignore_nofocus.so" => "x86/x_ignore_nofocus.so" },377 { "linux64/Release/x_ignore_nofocus.so" => "amd64/x_ignore_nofocus.so" }378 ])379380java_test(:name => "webdriver-firefox-test",381 :srcs => [ "firefox/test/java/**/*.java" ],382 :deps => [383 :'webdriver-firefox',384 :'webdriver-common-test',385 ])386387java_test(:name => "ide-test",388 :srcs => [ "ide/test/java/**/*.java" ],389 :deps => [390 :'webdriver-firefox',391 :'webdriver-common-test',392 "se_ide:ensure_proxy_setup"393 ])394 395java_test(:name => "webdriver-single-testsuite",396 :srcs => [ "common/test/java/org/openqa/selenium/SingleTestSuite.java"],397 :deps => [398 :'webdriver-ie',399 :'webdriver-common-test',400 ])401402java_jar(:name => "webdriver-support",403 :srcs => [ "support/src/java/**/*.java" ],404 :deps => [405 :common,406 "support/lib/runtime/*.jar",407 "third_party/java/google-collect-1.0.jar",408 ])409410java_test(:name => "webdriver-support-test",411 :srcs => [ "support/test/java/**/*.java" ],412 :deps => [413 :support,414 :test_common,415 ])416417java_jar(:name => "webdriver-remote-common",418 :srcs => [ "remote/common/src/java/**/*.java" ],419 :deps => [420 :common,421 "remote/common/lib/runtime/*.jar",422 "third_party/java/google-collect-1.0.jar",423 ])424425java_jar(:name => "webdriver-remote-client",426 :srcs => [ "remote/client/src/java/**/*.java" ],427 :deps => [428 :common,429 :'webdriver-remote-common',430 "remote/client/lib/runtime/*.jar",431 ])432433xpt(:name => "ide-auto-complete",434 :src => [ "ide/src/extension/idl/SeleniumIDEGenericAutoCompleteSearch.idl" ],435 :prebuilt => "ide/prebuilt",436 :out => "SeleniumIDEGenericAutoCompleteSearch.xpt")437438xpi(:name => "ide",439 :srcs => [],440 :deps => [],441 :resources => [442 { "ide/src/extension/chrome/" => "/" },443 { "common/src/js/core/*" => "chrome/content/selenium/"},444 { "ide/src/extension/content" => "chrome/" },445 { "ide/src/extension/skin" => "chrome/" },446 { "ide/src/extension/locale" => "chrome/" },447 { :"ide-auto-complete" => "components/" },448 { "ide/src/extension/components/SeleniumIDEGenericAutoCompleteSearch.js" => "components/" },449 { "ide/src/extension/install.rdf" => "/" },450 { "ide/src/extension/chrome.manifest.production" => "/chrome.manifest" },451 { "common/src/js/core/scripts/selenium-testrunner.js" => "content-files/" }452 ],453 :out => "selenium-ide-1.0.6-SNAPSHOT.xpi")454455java_jar(:name => "selenium-common-js",456 :resources => [457 "common/src/js/core",458 "common/src/js/jsunit",459 {460 "common/src/js/core/TestRunner.html" => "core/TestRunner.hta",461 "common/src/js/core/RemoteRunner.html" => "core/RemoteRunner.hta",462 }])463464java_jar(:name => "webdriver-remote-server",465 :srcs => [ "remote/server/src/java/**/*.java" ],466 :resources => [467 {468 "remote/server/src/java/org/openqa/jetty/http/mime.properties" => "org/openqa/jetty/http/mime.properties",469 "remote/server/src/java/org/openqa/jetty/http/encoding.properties" => "org/openqa/jetty/http/encoding.properties",470 },471 "remote/server/src/java/customProfileDir*",472 "remote/server/src/java/cybervillains",473 "remote/server/src/java/hudsuckr",474 "remote/server/src/java/killableprocess",475 "remote/server/src/java/konqueror",476 "remote/server/src/java/opera",477 "remote/server/src/java/sslSupport",478 "remote/server/src/java/VERSION.txt",479 "common/src/js/core",480 "common/src/js/jsunit",481 {482 "common/src/js/core/TestRunner.html" => "core/TestRunner.hta",483 "common/src/js/core/RemoteRunner.html" => "core/RemoteRunner.hta",484 },485 ],486 :deps => [487 :chrome,488 :htmlunit,489 :ie,490 :firefox,491 :remote_common,492 :selenium,493 :support,494 "remote/server/lib/runtime/*.jar"495 ])496497java_uberjar(:name => "selenium-server",498 :deps => [ "webdriver-remote-server", :selenium ],499 :exclude => [500 "META-INF/BCKEY.*"501 ],502 :main => "org.openqa.selenium.server.SeleniumServer",503 :no_libs => true)504 505task :'selenium-server_zip' do506 temp = "build/selenium-server_zip"507 mkdir_p temp508 sh "cd #{temp} && jar xf ../selenium-server.zip", :verbose => false509 rm_f "build/selenium-server.zip"510 Dir["#{temp}/webdriver-*.jar"].each { |file| rm_rf file }511 mv "#{temp}/selenium-server.jar", "#{temp}/selenium-server-#{version}.jar"512 sh "cd #{temp} && jar cMf ../selenium-server.zip *", :verbose => false513end514515java_uberjar(:name => "selenium-server-standalone",516 :deps => [ :'selenium-server' ],517 :standalone => true,518 :exclude => [519 "META-INF/BCKEY.*"520 ],521 :main => "org.openqa.selenium.server.SeleniumServer")522523java_jar(:name => "webdriver-remote-common-test",524 :srcs => [ "remote/common/test/java/**/*.java" ],525 :deps => [526 :remote_common,527 :test_common528 ])529530java_test(:name => "webdriver-selenium-server-test",531 :srcs => [532 "remote/client/test/java/**/*.java",533 "remote/server/test/java/org/openqa/selenium/remote/**/*.java",534 "remote/server/test/java/org/openqa/selenium/server/**/*.java",535 "remote/server/test/java/org/openqa/selenium/testworker/**/*.java"536 ],537 :deps => [538 :remote_client,539 :remote_server,540 :test_common,541 :'webdriver-remote-common-test',542 "remote/server/lib/buildtime/*.jar"543 ])544545java_war(:name => "webdriver-remote-servlet",546 :deps => [ :'webdriver-remote-server' ],547 :resources => [548 "remote/server/src/web/**"549 ]550 )551552dll(:name => "chrome_dll",553 :src => [ "common/src/cpp/webdriver-interactions/**/*", "chome/src/cpp/**/*" ],554 :solution => "WebDriver.sln",555 :out => 'Win32/Release/npchromedriver.dll',556 :prebuilt => "chrome/prebuilt")557558xpi(:name => "chrome_extension",559 :srcs => [ "chrome/src/extension/**" ],560 :deps => [ :chrome_dll ],561 :resources => [562 { :chrome_dll => "npchromedriver.dll" }563 ],564 :out => "chrome-extension.zip")565566java_jar(:name => "webdriver-selenium",567 :srcs => [ "selenium/src/java/**/*.java" ],568 :deps => [569 :chrome,570 :ie,571 :firefox,572 :remote_client,573 :support,574 "selenium/lib/runtime/*.jar"575 ],576 :resources => [577 { "selenium/src/java/org/openqa/selenium/internal/seleniumemulation/injectableSelenium.js" => "org/openqa/selenium/internal/seleniumemulation/injectableSelenium.js" },578 { "selenium/src/java/org/openqa/selenium/internal/seleniumemulation/htmlutils.js" => "org/openqa/selenium/internal/seleniumemulation/htmlutils.js" }579 ])580581java_test(:name => "webdriver-selenium-test",582 :srcs => [ "selenium/test/java/**/*.java" ],583 :resources => [584 { "selenium/test/java/com/thoughtworks/selenium/testHelpers.js" => "com/thoughtworks/selenium/testHelpers.js" },585 ],586 :deps => [587 :test_common,588 :htmlunit,589 :'selenium-server-standalone',590 "selenium/lib/buildtime/*.jar",591 ],592 :main => "org.testng.TestNG",593 :args => "selenium/test/java/webdriver-selenium-suite.xml")594595java_test(:name => "webdriver-selenese-test",596 :srcs => [ "selenium/test/java/**/*.java" ],597 :deps => [598 :test_common,599 :htmlunit,600 :'selenium-server-standalone',601 "selenium/lib/buildtime/*.jar",602 ])603604java_jar(:name => "selenium-core",605 :resources => [606 {"selenium/test/js/**" => "tests"},607 "common/src/js/core"608 ])609610selenium_test(:name => "test_core_firefox",611 :srcs => [ "common/test/js/core/*.js" ],612 :deps => [ 613 :"webdriver-remote-server",614 :"selenium-core" 615 ],616 :browser => "*chrome" )617 618selenium_test(:name => "test_core_ie",619 :srcs => [ "common/test/js/core/*.js" ],620 :deps => [ 621 :"webdriver-remote-server",622 :"selenium-core" 623 ],624 :browser => "*iexploreproxy")625626java_jar(:name => "webdriver-jsapi",627 :srcs => [ "remote/server/test/java/**/JsApi*.java" ],628 :deps => [ :firefox, :test_common ])629630# Comprehensive test suite for testing the JS API in isolation against all of631# the supported browsers. This should be included in the :test task; for that we632# defer to the suites for the individual drivers.633java_test(:name => "webdriver-jsapi-test",634 :srcs => [ "jsapi/test/java/**/*.java" ],635 :deps => [ :firefox, :chrome, :test_common ])636637# Simply starts the Jetty6AppServer for manually testing the JS API tests.638# After starting, open a browser to http://localhost:$PORT/js/test, where $PORT639# is the port the server was started on.640java_test(:name => "debug_jsapi",641 :deps => [ :firefox, :test_common ],642 :main => "org.openqa.selenium.environment.webserver.Jetty6AppServer")643644task :javadocs => [:common, :firefox, :htmlunit, :jobbie, :remote, :support, :chrome, :selenium] do645 mkdir_p "build/javadoc", :verbose => false646 sourcepath = ""647 classpath = "support/lib/runtime/hamcrest-all-1.1.jar"648 %w(common firefox jobbie htmlunit support remote/common remote/client chrome selenium).each do |m|649 sourcepath += ":#{m}/src/java"650 end651 cmd = "javadoc -d build/javadoc -sourcepath #{sourcepath} -classpath #{classpath} -subpackages org.openqa.selenium -subpackages com.thoughtworks"652 if (windows?) 653 cmd = cmd.gsub(/\//, "\\").gsub(/:/, ";") 654 end655 sh cmd656end657658task :test_firefox_py => [:firefox, :firefox_xpi] do659 if python? then660 sh "virtualenv build/python", :verbose => true do |ok, res|661 if ! ok662 puts ""663 puts "PYTHON DEPENDENCY ERROR: Virtualenv not found."664 puts "Please run '[sudo] pip install virtualenv'"665 puts ""666 end667 end668 sh "build/python/bin/pip install simplejson py", :verbose => true669 cp 'build/webdriver-extension.zip', "firefox/src/py/", :verbose => true670 sh "build/python/bin/python setup.py build", :verbose => true671 if File.exists?('build/python/bin/py.test')672 py_test = 'build/python/bin/py.test'673 else674 py_test = 'py.test'675 end676 test_dir = Dir.glob('build/lib**/selenium/firefox_tests').first677 sh py_test, test_dir, :verbose => true678 end679end680681task :test_selenium_py => [:'selenium-core', :'selenium-server-standalone'] do682 if python? then683 sh "python2.6 selenium/test/py/runtests.py", :verbose => true684 end685end686687# Place-holder tasks688java_jar(:name => "webdriver-iphone-client",689 :srcs => [ "iphone/src/java/**/*.java" ],690 :deps => [691 :common,692 :remote_common,693 :remote_client694 ])695696iphone_test(:name => "webdriver-iphone-client-test",697 :srcs => [ "iphone/test/java/**/*.java" ],698 :deps => [699 :test_common,700 :iphone_server,701 :iphone_client702 ])703704705#### iPhone ####706task :iphone_server do707 sdk = iPhoneSDK?708 if sdk != nil then709 puts "Building iWebDriver iphone app"710 sh "cd iphone && xcodebuild -sdk #{sdk} ARCHS=i386 -target iWebDriver >/dev/null", :verbose => false711 else712 puts "XCode not found. Not building the iphone driver."713 end714end715716# This does not depend on :iphone_server because the dependancy is specified in xcode717task :test_iphone_server do718 sdk = iPhoneSDK?719 if sdk != nil then720 sh "cd iphone && xcodebuild -sdk #{sdk} ARCHS=i386 -target Tests"721 else722 puts "XCode and/or iPhoneSDK not found. Not testing iphone_server."723 end724end725726def version727 `svn info | grep Revision | awk -F: '{print $2}' | tr -d '[:space:]' | tr -d '\n'`728end729730task :remote_release => [:remote] do731 mkdir_p "build/dist/remote_client", :verbose => false732733 cp 'remote/build/webdriver-remote-client.jar', 'build/dist/remote_client'734 cp 'remote/build/webdriver-remote-common.jar', 'build/dist/remote_client'735 cp 'common/build/webdriver-common.jar', 'build/dist/remote_client'736737 cp Dir.glob('remote/common/lib/runtime/*.jar'), 'build/dist/remote_client'738 cp Dir.glob('remote/client/lib/runtime/*.jar'), 'build/dist/remote_client'739 cp 'third_party/java/google-collect-1.0.jar', 'build/dist/remote_client'740741 sh "cd build/dist && zip -r webdriver-remote-client-#{version}.zip remote_client/*"742 rm_rf "build/dist/remote_client", :verbose => false743744 mkdir_p "build/dist/remote_server", :verbose => false745746 cp 'remote/build/webdriver-remote-server.jar', 'build/dist/remote_server'747 cp 'remote/build/webdriver-remote-common.jar', 'build/dist/remote_server'748 cp 'common/build/webdriver-common.jar', 'build/dist/remote_server'749750 cp Dir.glob('remote/common/lib/runtime/*.jar'), 'build/dist/remote_server'751 cp Dir.glob('remote/server/lib/runtime/*.jar'), 'build/dist/remote_server'752 cp 'third_party/java/google-collect-1.0.jar', 'build/dist/remote_server'753754 rm Dir.glob('build/dist/remote_server/servlet*.jar')755756 sh "cd build/dist && zip -r webdriver-remote-server-#{version}.zip remote_server/*"757 rm_rf "build/dist/remote_server", :verbose => false758end759760java_uberjar(:name => "selenium-java",761 :deps => [762 :chrome,763 :htmlunit,764 :ie,765 :firefox,766 :remote_client,767 :selenium,768 :support769 ],770 :no_libs => true)771772task :release => [:'all_zip', :'selenium-server-standalone', :'selenium-server_zip'] do773 cp "build/selenium-server-standalone.jar", "build/selenium-server-standalone-#{version}.jar"774 cp "build/selenium-java.zip", "build/selenium-java-#{version}.zip"775 cp "build/selenium-server.zip", "build/selenium-server-#{version}.zip"776end777778task :'selenium-java_zip' do779 temp = "build/selenium-java_zip" ...

Full Screen

Full Screen

selenium-webdriver-2.29.0.gemspec

Source:selenium-webdriver-2.29.0.gemspec Github

copy

Full Screen

...6 s.authors = ["Jari Bakken"]7 s.date = %q{2013-01-20}8 s.description = %q{WebDriver is a tool for writing automated tests of websites. It aims to mimic the behaviour of a real user, and as such interacts with the HTML of the application.}9 s.email = %q{jari.bakken@gmail.com}10 s.files = ["lib/selenium-client.rb", "lib/selenium-webdriver.rb", "lib/selenium/client.rb", "lib/selenium/server.rb", "lib/selenium/webdriver.rb", "lib/selenium/client/base.rb", "lib/selenium/client/driver.rb", "lib/selenium/client/errors.rb", "lib/selenium/client/extensions.rb", "lib/selenium/client/idiomatic.rb", "lib/selenium/client/javascript_expression_builder.rb", "lib/selenium/client/legacy_driver.rb", "lib/selenium/client/protocol.rb", "lib/selenium/client/selenium_helper.rb", "lib/selenium/client/javascript_frameworks/jquery.rb", "lib/selenium/client/javascript_frameworks/prototype.rb", "lib/selenium/rake/server_task.rb", "lib/selenium/webdriver/android.rb", "lib/selenium/webdriver/chrome.rb", "lib/selenium/webdriver/common.rb", "lib/selenium/webdriver/firefox.rb", "lib/selenium/webdriver/ie.rb", "lib/selenium/webdriver/iphone.rb", "lib/selenium/webdriver/opera.rb", "lib/selenium/webdriver/phantomjs.rb", "lib/selenium/webdriver/remote.rb", "lib/selenium/webdriver/safari.rb", "lib/selenium/webdriver/support.rb", "lib/selenium/webdriver/android/bridge.rb", "lib/selenium/webdriver/chrome/bridge.rb", "lib/selenium/webdriver/chrome/profile.rb", "lib/selenium/webdriver/chrome/service.rb", "lib/selenium/webdriver/common/action_builder.rb", "lib/selenium/webdriver/common/alert.rb", "lib/selenium/webdriver/common/bridge_helper.rb", "lib/selenium/webdriver/common/driver.rb", "lib/selenium/webdriver/common/element.rb", "lib/selenium/webdriver/common/error.rb", "lib/selenium/webdriver/common/file_reaper.rb", "lib/selenium/webdriver/common/json_helper.rb", "lib/selenium/webdriver/common/keyboard.rb", "lib/selenium/webdriver/common/keys.rb", "lib/selenium/webdriver/common/log_entry.rb", "lib/selenium/webdriver/common/mouse.rb", "lib/selenium/webdriver/common/navigation.rb", "lib/selenium/webdriver/common/options.rb", "lib/selenium/webdriver/common/platform.rb", "lib/selenium/webdriver/common/port_prober.rb", "lib/selenium/webdriver/common/profile_helper.rb", "lib/selenium/webdriver/common/proxy.rb", "lib/selenium/webdriver/common/search_context.rb", "lib/selenium/webdriver/common/socket_poller.rb", "lib/selenium/webdriver/common/target_locator.rb", "lib/selenium/webdriver/common/timeouts.rb", "lib/selenium/webdriver/common/touch_action_builder.rb", "lib/selenium/webdriver/common/touch_screen.rb", "lib/selenium/webdriver/common/wait.rb", "lib/selenium/webdriver/common/window.rb", "lib/selenium/webdriver/common/zipper.rb", "lib/selenium/webdriver/common/core_ext/base64.rb", "lib/selenium/webdriver/common/core_ext/dir.rb", "lib/selenium/webdriver/common/core_ext/string.rb", "lib/selenium/webdriver/common/driver_extensions/has_browser_connection.rb", "lib/selenium/webdriver/common/driver_extensions/has_input_devices.rb", "lib/selenium/webdriver/common/driver_extensions/has_location.rb", "lib/selenium/webdriver/common/driver_extensions/has_touch_screen.rb", "lib/selenium/webdriver/common/driver_extensions/has_web_storage.rb", "lib/selenium/webdriver/common/driver_extensions/rotatable.rb", "lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb", "lib/selenium/webdriver/common/driver_extensions/uploads_files.rb", "lib/selenium/webdriver/common/html5/local_storage.rb", "lib/selenium/webdriver/common/html5/location.rb", "lib/selenium/webdriver/common/html5/session_storage.rb", "lib/selenium/webdriver/common/html5/shared_web_storage.rb", "lib/selenium/webdriver/firefox/binary.rb", "lib/selenium/webdriver/firefox/bridge.rb", "lib/selenium/webdriver/firefox/extension.rb", "lib/selenium/webdriver/firefox/launcher.rb", "lib/selenium/webdriver/firefox/profile.rb", "lib/selenium/webdriver/firefox/profiles_ini.rb", "lib/selenium/webdriver/firefox/socket_lock.rb", "lib/selenium/webdriver/firefox/util.rb", "lib/selenium/webdriver/firefox/extension/prefs.json", "lib/selenium/webdriver/firefox/extension/webdriver.xpi", "lib/selenium/webdriver/firefox/native/linux/amd64/x_ignore_nofocus.so", "lib/selenium/webdriver/firefox/native/linux/x86/x_ignore_nofocus.so", "lib/selenium/webdriver/ie/bridge.rb", "lib/selenium/webdriver/ie/server.rb", "lib/selenium/webdriver/iphone/bridge.rb", "lib/selenium/webdriver/opera/bridge.rb", "lib/selenium/webdriver/opera/service.rb", "lib/selenium/webdriver/phantomjs/bridge.rb", "lib/selenium/webdriver/phantomjs/service.rb", "lib/selenium/webdriver/remote/bridge.rb", "lib/selenium/webdriver/remote/capabilities.rb", "lib/selenium/webdriver/remote/commands.rb", "lib/selenium/webdriver/remote/response.rb", "lib/selenium/webdriver/remote/server_error.rb", "lib/selenium/webdriver/remote/http/common.rb", "lib/selenium/webdriver/remote/http/curb.rb", "lib/selenium/webdriver/remote/http/default.rb", "lib/selenium/webdriver/remote/http/persistent.rb", "lib/selenium/webdriver/safari/bridge.rb", "lib/selenium/webdriver/safari/browser.rb", "lib/selenium/webdriver/safari/server.rb", "lib/selenium/webdriver/support/abstract_event_listener.rb", "lib/selenium/webdriver/support/block_event_listener.rb", "lib/selenium/webdriver/support/color.rb", "lib/selenium/webdriver/support/event_firing_bridge.rb", "lib/selenium/webdriver/support/select.rb", "CHANGES", "README", "COPYING"]11 s.homepage = %q{http://selenium.googlecode.com}12 s.require_paths = ["lib"]13 s.rubygems_version = %q{1.3.6}14 s.summary = %q{The next generation developer focused tool for automated testing of webapps}15 if s.respond_to? :specification_version then16 current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION17 s.specification_version = 318 if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then19 s.add_runtime_dependency(%q<multi_json>, ["~> 1.0"])20 s.add_runtime_dependency(%q<rubyzip>, [">= 0"])21 s.add_runtime_dependency(%q<childprocess>, [">= 0.2.5"])22 s.add_runtime_dependency(%q<websocket>, ["~> 1.0.4"])23 s.add_development_dependency(%q<rspec>, ["~> 2.0"])24 s.add_development_dependency(%q<rack>, ["~> 1.0"])...

Full Screen

Full Screen

env.rb

Source:env.rb Github

copy

Full Screen

...19$brw = ENV['BROWSER']20case $brw21 when "ff"22 require 'selenium-webdriver'23 caps = Selenium::WebDriver::Remote::Capabilities.firefox("firefoxOptions" => {"args" => [ "--allow-running-insecure-content" ]}) #"--disable-web-security",24 Capybara.configure do |config|25 config.default_driver = :selenium26 config.default_selector = :css27 config.default_wait_time = 1028 end29 Capybara.page.driver.browser.manage.window.maximize30 Capybara.register_driver :selenium do |app|31 profile = Selenium::WebDriver::Firefox::Profile.new32 Capybara::Selenium::Driver.new(app, :browser => :firefox, :profile => profile, :desired_capabilities => caps)33 end34when "chrome"35 require 'selenium-webdriver'36 puts "BROWSER = "+ENV['BROWSER']37 caps = Selenium::WebDriver::Remote::Capabilities.chrome("chromeOptions" => {"args" => [ "--allow-running-insecure-content" ]}) #"--disable-web-security",38 Capybara.register_driver :chrome do |app|39 Capybara::Selenium::Driver.new(app, :browser => :chrome, :desired_capabilities => caps)40 end41 Capybara.default_driver = :chrome42 Capybara.default_wait_time = 1043 Capybara.default_selector = :css44 Capybara.page.driver.browser.manage.window.maximize45when "ie"46 puts "BROWSER = "+ENV['BROWSER']47 Capybara.register_driver :selenium_ie do |app|48 Capybara::Selenium::Driver.new(app, :browser => :ie)49 end50 Capybara.default_driver = :selenium_ie51 Capybara.default_wait_time = 1552 Capybara.page.driver.browser.manage.window.maximize53 when "grid-firefox"54 require 'selenium-webdriver'55 # driver = Selenium::WebDriver.for(:remote, :url => "http://127.0.0.1:5555/wd/hub", :desired_capabilities => :firefox)56 caps = Selenium::WebDriver::Remote::Capabilities.firefox("firefoxOptions" => {"args" => [ "--allow-running-insecure-content" ]})57 Capybara.default_driver = :selenium58 Capybara.register_driver :selenium do |app|59 Capybara::Selenium::Driver.new(app,60 :browser => :remote,61 :url => "http://127.0.0.1:5555/wd/hub",62 :desired_capabilities => caps)63 end64 when "grid-chrome"65 require 'selenium-webdriver'66 # driver = Selenium::WebDriver.for(:remote, :url => "http://127.0.0.1:5555/wd/hub", :desired_capabilities => :firefox)67 caps = Selenium::WebDriver::Remote::Capabilities.chrome("chromeOptions" => {"args" => [ "--allow-running-insecure-content" ]})68 Capybara.default_driver = :selenium69 Capybara.register_driver :selenium do |app|70 Capybara::Selenium::Driver.new(app,71 :browser => :remote,72 :url => "http://127.0.0.1:8989/wd/hub",73 :desired_capabilities => caps)74 end75 when "grid-ie"76 require 'selenium-webdriver'77 # driver = Selenium::WebDriver.for(:remote, :url => "http://127.0.0.1:5555/wd/hub", :desired_capabilities => :firefox)78 caps = Selenium::WebDriver::Remote::Capabilities.ie79 Capybara.default_driver = :selenium80 Capybara.register_driver :selenium do |app|81 Capybara::Selenium::Driver.new(app,82 :browser => :remote,83 :url => "http://127.0.0.1:9999/wd/hub",84 :desired_capabilities => caps)85 end86else87Capybara.configure do |config|88 config.default_driver = :selenium89 #config.run_server = false90 config.default_selector = :css91 config.default_wait_time = 1092end93 Capybara.page.driver.browser.manage.window.maximize94 Capybara.register_driver :selenium do |app|95 profile = Selenium::WebDriver::Firefox::Profile.new96 Capybara::Selenium::Driver.new(app, :browser => :firefox, :profile => profile)97 end98end99require File.dirname(__FILE__) + '/lib/configuration';100BASE_URL = Configuration["base_url"]101$base_url = BASE_URL...

Full Screen

Full Screen

webdriver.rb

Source:webdriver.rb Github

copy

Full Screen

...11 Dimension = Struct.new(:width, :height)12 Location = Struct.new(:latitude, :longitude, :altitude)13 autoload :Android, 'selenium/webdriver/android'14 autoload :Chrome, 'selenium/webdriver/chrome'15 autoload :Firefox, 'selenium/webdriver/firefox'16 autoload :IE, 'selenium/webdriver/ie'17 autoload :IPhone, 'selenium/webdriver/iphone'18 autoload :Opera, 'selenium/webdriver/opera'19 autoload :PhantomJS, 'selenium/webdriver/phantomjs'20 autoload :Remote, 'selenium/webdriver/remote'21 autoload :Safari, 'selenium/webdriver/safari'22 autoload :Support, 'selenium/webdriver/support'23 # @api private24 def self.root25 @root ||= File.expand_path("../..", __FILE__)26 end27 #28 # Create a new Driver instance with the correct bridge for the given browser29 #30 # @param browser [:ie, :internet_explorer, :remote, :chrome, :firefox, :ff, :android, :iphone, :opera, :phantomjs, :safari]31 # the driver type to use32 # @param *rest33 # arguments passed to Bridge.new34 #35 # @return [Driver]36 #37 # @see Selenium::WebDriver::Remote::Bridge38 # @see Selenium::WebDriver::Firefox::Bridge39 # @see Selenium::WebDriver::IE::Bridge40 # @see Selenium::WebDriver::Chrome::Bridge41 # @see Selenium::WebDriver::Android::Bridge42 # @see Selenium::WebDriver::IPhone::Bridge43 # @see Selenium::WebDriver::Opera::Bridge44 # @see Selenium::WebDriver::PhantomJS::Bridge45 # @see Selenium::WebDriver::Safari::Bridge46 #47 # @example48 #49 # WebDriver.for :firefox, :profile => "some-profile"50 # WebDriver.for :firefox, :profile => Profile.new51 # WebDriver.for :remote, :url => "http://localhost:4444/wd/hub", :desired_capabilities => caps52 #53 # One special argument is not passed on to the bridges, :listener. You can pass a listener for this option54 # to get notified of WebDriver events. The passed object must respond to #call or implement the methods from AbstractEventListener.55 #56 # @see Selenium::WebDriver::Support::AbstractEventListener57 #58 def self.for(*args)59 WebDriver::Driver.for(*args)60 end61 end # WebDriver62end # Selenium...

Full Screen

Full Screen

firefox

Using AI Code Generation

copy

Full Screen

1element = driver.find_element(:name, 'q')2element = driver.find_element(:name, 'q')3element = driver.find_element(:name, 'q')4element = driver.find_element(:name, 'q')5element = driver.find_element(:name, 'q')6element = driver.find_element(:name, 'q')7element = driver.find_element(:name, 'q')

Full Screen

Full Screen

firefox

Using AI Code Generation

copy

Full Screen

1driver.find_element(:name, "q").send_keys "Selenium WebDriver"2driver.find_element(:name, "btnG").click3driver.find_element(:name, "q").send_keys "Selenium WebDriver"4driver.find_element(:name, "btnG").click5driver.find_element(:name, "q").send_keys "Selenium WebDriver"6driver.find_element(:name, "btnG").click7driver.find_element(:name, "q").send_keys "Selenium WebDriver"8driver.find_element(:name, "btnG").click9driver.find_element(:name, "q").send_keys "Selenium WebDriver"10driver.find_element(:name, "btnG").click11driver.find_element(:name, "q").send_keys "Selenium WebDriver"12driver.find_element(:name, "btnG").click

Full Screen

Full Screen

firefox

Using AI Code Generation

copy

Full Screen

1driver.find_element(:name, 'q').send_keys "Selenium WebDriver"2driver.find_element(:name, 'btnG').click3driver.find_element(:name, 'q').send_keys "Selenium WebDriver"4driver.find_element(:name, 'btnG').click5driver.find_element(:name, 'q').send_keys "Selenium WebDriver"6driver.find_element(:name, 'btnG').click

Full Screen

Full Screen

firefox

Using AI Code Generation

copy

Full Screen

1element = driver.find_element(:name, 'q')2element = driver.find_element(:name, 'q')3element = driver.find_element(:name, 'q')4element = driver.find_element(:name, 'q')5element = driver.find_element(:name, 'q')6element = driver.find_element(:name, 'q')7element = driver.find_element(:name, 'q')

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Selenium automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Most used method in

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful