{"id":1438,"date":"2021-11-02T09:37:28","date_gmt":"2021-11-02T09:37:28","guid":{"rendered":"https:\/\/blog.amt.in\/?p=1438"},"modified":"2021-11-02T09:37:28","modified_gmt":"2021-11-02T09:37:28","slug":"introduction-to-selenium","status":"publish","type":"post","link":"https:\/\/blog.amt.in\/index.php\/2021\/11\/02\/introduction-to-selenium\/","title":{"rendered":"Introduction to Selenium"},"content":{"rendered":"<p>Selenium\u00c2\u00a0is a portable\u00c2\u00a0software-testing\u00c2\u00a0framework\u00c2\u00a0for\u00c2\u00a0web applications.\u00c2\u00a0Selenium provides a playback (formerly also recording) tool for authoring tests without the need to learn a test\u00c2\u00a0scripting language\u00c2\u00a0(Selenium IDE).\u00c2\u00a0It also provides a test\u00c2\u00a0domain-specific language\u00c2\u00a0(Selenese) to write tests in a number of popular programming languages.\u00c2\u00a0The tests can then run against most modern\u00c2\u00a0web browsers. Selenium deploys on\u00c2\u00a0Windows,\u00c2\u00a0Linux, and\u00c2\u00a0macOS\u00c2\u00a0platforms. It is\u00c2\u00a0open-source software, released under the\u00c2\u00a0Apache 2.0 license: web developers can download and use it without charge.<\/p>\n<p>Selenium is composed of several components with each taking on a specific role in aiding the development of web application\u00c2\u00a0test automation.<\/p>\n<p><span id=\"Selenium_IDE\" class=\"mw-headline\">Selenium IDE:<\/span><\/p>\n<p>Selenium IDE is a complete\u00c2\u00a0integrated development environment\u00c2\u00a0(IDE) for Selenium tests. It is implemented as a\u00c2\u00a0Firefox Add-On\u00c2\u00a0and available on\u00c2\u00a0Chrome Store\u00c2\u00a0recently, and allows recording, editing, and debugging tests. It was previously known as Selenium Recorder. Selenium-IDE was originally created by Shinya Kasatani and donated to the Selenium project in 2006. It is little-maintained and is compatible with Selenium RC, which was deprecated.\u00c2\u00a0Scripts may be automatically recorded and edited manually providing\u00c2\u00a0autocompletion\u00c2\u00a0support and the ability to move commands around quickly. Scripts are recorded in\u00c2\u00a0Selenese, a special test scripting language for Selenium. Selenese provides commands for performing actions in a browser (click a link, select an option), and for retrieving data from the resulting pages.<\/p>\n<p><span id=\"Selenium_client_API\" class=\"mw-headline\">Selenium client API:<\/span><\/p>\n<p>As an alternative to writing tests in Selenese, tests can also be written in various programming languages. These tests then communicate with Selenium by calling methods in the Selenium Client API. Selenium currently provides client APIs for\u00c2\u00a0Java,\u00c2\u00a0C#,\u00c2\u00a0Ruby,\u00c2\u00a0JavaScript\u00c2\u00a0and\u00c2\u00a0Python.<\/p>\n<p><span id=\"Selenium_WebDriver\" class=\"mw-headline\">Selenium Web-Driver:<\/span><\/p>\n<p>Selenium Web-Driver is the successor to Selenium RC. Selenium Web-Driver accepts commands (sent in Selenese, or via a Client API) and sends them to a browser. This is implemented through a browser-specific browser driver, which sends commands to a browser and retrieves results. Most browser drivers actually launch and access a browser application (such as\u00c2\u00a0Firefox,\u00c2\u00a0Chrome,\u00c2\u00a0Internet Explorer,\u00c2\u00a0Safari, or\u00c2\u00a0Microsoft Edge); there is also an\u00c2\u00a0Html-Unit\u00c2\u00a0browser driver, which simulates a browser using the headless browser Html-Unit.<\/p>\n<p><span id=\"Selenium_Remote_Control\" class=\"mw-headline\">Selenium Remote Control:<\/span><\/p>\n<p>Selenium Remote Control (RC) is a server, written in\u00c2\u00a0Java, that accepts commands for the browser via\u00c2\u00a0HTTP. RC makes it possible to write automated tests for a web application in any programming language, which allows for better integration of Selenium in existing unit test frameworks. To make writing tests easier, Selenium project currently provides client drivers for\u00c2\u00a0PHP,\u00c2\u00a0Python,\u00c2\u00a0Ruby,\u00c2\u00a0.NET,\u00c2\u00a0Perl\u00c2\u00a0and\u00c2\u00a0Java. The Java driver can also be used with\u00c2\u00a0JavaScript\u00c2\u00a0(via the\u00c2\u00a0Rhino\u00c2\u00a0engine). An instance of selenium RC server is needed to launch html test case &#8211; which means that the port should be different for each parallel run. However, for Java\/PHP test case only one Selenium RC instance needs to be running continuously.<\/p>\n<p><span id=\"Selenium_Grid\" class=\"mw-headline\">Selenium Grid:<\/span><\/p>\n<p>Selenium Grid is a server that allows tests to use web browser instances running on remote machines. With Selenium Grid, one server acts as the hub. Tests contact the hub to obtain access to browser instances. The hub has a list of servers that provide access to browser instances (Web-Driver nodes), and lets tests use these instances. Selenium Grid allows running tests in parallel on multiple machines, and to manage different browser versions and browser configurations centrally (instead of in each individual test).<\/p>\n<p>The above is a brief about Selenium. Watch this space for more updates on the latest trends in Technology.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Selenium\u00c2\u00a0is a portable\u00c2\u00a0software-testing\u00c2\u00a0framework\u00c2\u00a0for\u00c2\u00a0web applications.\u00c2\u00a0Selenium provides<\/p>\n","protected":false},"author":1,"featured_media":1439,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[207,846,7],"tags":[210,847,18],"class_list":["post-1438","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-selenium","category-software-testing-framework","category-techtrends","tag-selenium","tag-software-testing-framework","tag-technology"],"_links":{"self":[{"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/posts\/1438","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/comments?post=1438"}],"version-history":[{"count":1,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/posts\/1438\/revisions"}],"predecessor-version":[{"id":1440,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/posts\/1438\/revisions\/1440"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/media\/1439"}],"wp:attachment":[{"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/media?parent=1438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/categories?post=1438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/tags?post=1438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}