{"id":88434,"date":"2017-07-06T12:06:37","date_gmt":"2017-07-06T12:06:37","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=88434"},"modified":"2021-07-16T14:27:13","modified_gmt":"2021-07-16T14:27:13","slug":"page-object-model-pom-selenium","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/","title":{"rendered":"Page Object Model (POM) in Selenium"},"content":{"rendered":"\n<p><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">Selenium <\/span><\/span><\/span><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">doesn\u2019t inherently comes with any feature which provide any object management where we can manage the object information for a page <\/span><\/span><\/span><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">a<\/span><\/span><\/span><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">nd keep this object information outside the test script. <\/span><\/span><\/span><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">Yes, it\u2019s true, we can write the entire script for a page without a page object model and this could run th<\/span><\/span><\/span><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">r<\/span><\/span><\/span><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">ough. <\/span><\/span><\/span><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">This may state less pain to maintain the script only if we have limited test-cases(say 5-10). Considering if we have thousands of test-cases, is it easy to maintain <\/span><\/span><\/span><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">the<\/span><\/span><\/span><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\"> test script? We can\u2019t change the whole test-script once the AUT goes certain changes or some modifications (which generally happens down the road).<\/span><\/span><\/span><\/p>\n\n\n\n<p><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">S<\/span><\/span><\/span><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">o if the object info of a page change (the <\/span><\/span><\/span><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">probability<\/span><\/span><\/span><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\"> of which is higher) as the AUT undergoes changes with different release cycle, the impact of that change <\/span><\/span><\/span><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">on<\/span><\/span><\/span><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\"> the automation suite level is very <\/span><\/span><\/span><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">high <\/span><\/span><\/span><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">since the ob<\/span><\/span><\/span><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">ject<\/span><\/span><\/span><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\"> info i<\/span><\/span><\/span><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">n the script is hard coded.<\/span><\/span><\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span style=\"font-size: medium;\"><strong><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\">Why POM?<\/span><\/span><\/strong><\/span><\/h2>\n\n\n\n<p><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">POM has nowadays become popular test automation design pattern around the testing industry. POM facilitates as to concentrate on testing the AUT rather than fixing the automation suite (the changed objects) to perform the test. In POM the Object information is managed outside the test script, thus making easy to understand the test script.<\/span><\/span><\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span style=\"font-size: medium;\"><strong><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\">Advantages of POM<\/span><\/span><\/strong><\/span><\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">It makes ease in maintaining the code (flow in the UI is separated from verification)<\/span><\/span><\/span><\/li><li><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">Makes code readable <\/span><\/span><\/span><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">(<\/span><\/span><\/span><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">Methods <\/span><\/span><\/span><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">get <\/span><\/span><\/span><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">more realistic names<\/span><\/span><\/span><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">)<\/span><\/span><\/span><\/li><li><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">Makes the code reusable <\/span><\/span><\/span><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">(<\/span><\/span><\/span><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">object repository is independent of test cases)<\/span><\/span><\/span><\/li><li><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">The Code becomes less and optimised<\/span><\/span><\/span><\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><span style=\"font-size: medium;\"><strong><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\">Implementation of POM<\/span><\/span><\/strong><\/span><\/h2>\n\n\n\n<p><span style=\"color: #343434;\"><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">Let us consider a simple test<\/span><\/span><\/span><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\"> scenario <\/span><\/span><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">where we have an app with a login page, an account page and, say, home page.<\/span><\/span><\/p>\n\n\n\n<p><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">The scenario be like<\/span><\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">We go to the app url<\/span><\/span><\/li><li><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">Validate the app page is correct <\/span><\/span><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">(home page)<\/span><\/span><\/li><li><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">We go to the login page and fill the form with a valid id and password<\/span><\/span><\/li><li><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">We validate if the account page <\/span><\/span><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">opens<\/span><\/span><\/li><\/ul>\n\n\n\n<p><span style=\"font-family: Arial, sans-serif;\"><span style=\"font-size: medium;\">Now here we are dealing we three pages the home page, the login and the account page. Accordingly we create 3 POM classes, be like :<\/span><\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>HomePage.java<\/li><li>LoginPage.java<\/li><li>MyAccountPage.java<\/li><\/ul>\n\n\n\n<p>Also we create a test class with the test script and names it as<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>TestLogin.java<\/li><\/ul>\n\n\n\n<p><strong>HomePage.java<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted brush:java\">package pageModel;\n\nimport org.openqa.selenium.By;\nimport org.openqa.selenium.WebDriver;\n\npublic class HomePage\t{\n\tWebDriver driver;\n\tBy homeHeading = By.xpath(\"\/\/table\/\/tr[3][@class='heading3']\");\n\tBy loginButton = By.id(\"login\");\n\tpublic\tHomePage(WebDriver driver)\t{\n\t\tthis.driver = driver;\n\t}\n\t\/\/get the heading (the main heading which is present at the home page)\n\tpublic String getHomeHeading()\t{\n\t\tString heading = driver.findElement(homeHeading).getText();\n\t\treturn\theading;\n\t}\n\tpublic HomePage clickLoginButton()\t{\n\t\tdriver.findElement(loginButton).click();\n\t\treturn\tthis;\n\t}\n}<\/pre>\n\n\n\n<p><strong>LoginPage.java<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted brush:java\">package pageModel;\nimport org.openqa.selenium.By;\nimport org.openqa.selenium.WebDriver;\npublic class LoginPage\t{\n\tWebDriver driver;\n\tBy username = By.id(\"email\");\n\tBy password = By.name(\"email\");\n\tBy submitButton = By.cssSelector(\"input[type='submit']\");\n\tpublic\tLoginPage(WebDriver driver)\t{\n\t\tthis.driver = driver;\n\t}\n\tpublic LoginPage usernameAs(String email)\t{\n\t\tdriver.findElement(username).sendKeys(email);\n\t\treturn\tthis;\n\t}\n\tpublic LoginPage passwordAs(String pass)\t{\n\t\tdriver.findElement(password).sendKeys(pass);\n\t\treturn\tthis;\n\t}\n\tpublic void\tsubmit(){\n\t\tdriver.findElement(submitButton).click();\n\t}\n}<\/pre>\n\n\n\n<p><strong>MyAccountPage.java<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted brush:java\">package pageModel;\nimport org.openqa.selenium.By;\nimport org.openqa.selenium.WebDriver;\npublic class MyAccountPage\t{\n\tWebDriver driver;\n\t\/\/ Declaring the xpath for the heading in By class\n\tBy pageHeading = By.xpath(\"\/\/table\/\/tr[3][@class='heading3']\");\n\t\n\tpublic\tMyAccountPage(WebDriver driver)\t{\n\t\tthis.driver = driver;\n\t}\n\t\/\/get the heading (username for which the account belongs to)\n\tpublic String getHeading()\t{\n\t\tString heading = driver.findElement(pageHeading).getText();\n\t\treturn\theading;\n\t}\n}<\/pre>\n\n\n\n<p><strong>TestLogin.java<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted brush:java\">package test;\nimport org.junit.Assert;\nimport org.openqa.selenium.By;\nimport org.openqa.selenium.WebDriver;\nimport org.openqa.selenium.WebElement;\nimport org.openqa.selenium.chrome.ChromeDriver;\nimport org.testng.annotations.AfterTest;\nimport org.testng.annotations.BeforeTest;\nimport org.testng.annotations.Test;\n\nimport pageModel.*;\n\npublic class TestLogin {\n\tWebDriver driver;\t\n\t@BeforeTest\n\tpublic void setUp() throws Exception {\n\t\/\/ setting the driver executable for chrome browser\n\t\tString chrome_path = System.getProperty(\"user.dir\")+\"\/chromedriver\";\n\t\tdriver = new ChromeDriver();\t\t\t\t\/\/ created a new instance for chrome driver\n\t\tdriver.manage().window().maximize(); \n\t}\n\t\n\t@AfterTest\n\tpublic void tearDown() throws Exception {\n\t    driver.quit();\n\t}\n\n\t@Test(priority=1)\n\tpublic void test() throws InterruptedException{\n\t\tdriver.get(\"http:\/\/192.168.1.164:8080\/home.html\");\n\/\/\t\tvalidate if we are at the home page\n\t\tString homeHeading = new HomePage(driver).getHomeHeading() ;\n\t\tAssert.assertEquals(homeHeading, \"This is HOMEPAGE\", \"not at the home page\");\n\/\/\t\tredirect to the login page\n\t\tnew HomePage(driver).clickLoginButton();\n\/\/\t\tfill the login form\n\t\tnew LoginPage(driver)\n\t\t.usernameAs(\"foo@bar.com\")\n\t\t.passwordAs(\"secret\")\n\t\t.submit();\n\/\/\t\tcheck if redirected to account page with user name foo@bar.com\n\t\tString accountHeading = new HomePage(driver).getHomeHeading() ;\n\t\tAssert.assertEquals(accountHeading, \"Welcome foo@bar.com \", \"not at the account page\");\n\t}\n}\n<\/pre>\n\n\n\n<p>Now, if the AUT undergoes any change at the login page or at any page we just need to change the page object. Thus we don&#8217;t need to change our &nbsp;test script again and again (even for the new release or built). The project structure will look like :<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"429\" height=\"258\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/pom_structure.jpg\" alt=\"image\" class=\"wp-image-88496\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/pom_structure.jpg 429w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/pom_structure-250x150.jpg 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/pom_structure-300x180.jpg 300w\" sizes=\"(max-width: 429px) 100vw, 429px\" loading=\"lazy\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Selenium doesn\u2019t inherently comes with any feature which provide any object management where we can manage the object information for a page and keep this object information outside the test script. Yes, it\u2019s true, we can write the entire script for a page without a page object model and this could run through. This may <a href=\"https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":94,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4312,3137],"tags":[5021,5020,3138,5022],"class_list":["post-88434","post","type-post","status-publish","format-standard","hentry","category-automation-testing","category-testing","tag-page-object-model","tag-pom","tag-selenium","tag-selenium-pom"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Page Object Model (POM) in Selenium - Webkul Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Page Object Model (POM) in Selenium - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"Selenium doesn\u2019t inherently comes with any feature which provide any object management where we can manage the object information for a page and keep this object information outside the test script. Yes, it\u2019s true, we can write the entire script for a page without a page object model and this could run through. This may [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2017-07-06T12:06:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-07-16T14:27:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2017\/07\/pom_structure.jpg\" \/>\n<meta name=\"author\" content=\"Himanshu Chand\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Himanshu Chand\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/\"},\"author\":{\"name\":\"Himanshu Chand\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/08d4d0b31f228925099740afd668b50f\"},\"headline\":\"Page Object Model (POM) in Selenium\",\"datePublished\":\"2017-07-06T12:06:37+00:00\",\"dateModified\":\"2021-07-16T14:27:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/\"},\"wordCount\":437,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2017\/07\/pom_structure.jpg\",\"keywords\":[\"Page Object Model\",\"POM\",\"Selenium\",\"Selenium POM\"],\"articleSection\":[\"Automation testing\",\"Testing\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/\",\"url\":\"https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/\",\"name\":\"Page Object Model (POM) in Selenium - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2017\/07\/pom_structure.jpg\",\"datePublished\":\"2017-07-06T12:06:37+00:00\",\"dateModified\":\"2021-07-16T14:27:13+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/pom_structure.jpg\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/pom_structure.jpg\",\"width\":429,\"height\":258,\"caption\":\"project structure\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Page Object Model (POM) in Selenium\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/08d4d0b31f228925099740afd668b50f\",\"name\":\"Himanshu Chand\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/067d10770fdcc86d177164f68eb74b9528397b3a5fbf01970b6f6dfd48c64281?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/067d10770fdcc86d177164f68eb74b9528397b3a5fbf01970b6f6dfd48c64281?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Himanshu Chand\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/himanshu-chand168\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Page Object Model (POM) in Selenium - Webkul Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/","og_locale":"en_US","og_type":"article","og_title":"Page Object Model (POM) in Selenium - Webkul Blog","og_description":"Selenium doesn\u2019t inherently comes with any feature which provide any object management where we can manage the object information for a page and keep this object information outside the test script. Yes, it\u2019s true, we can write the entire script for a page without a page object model and this could run through. This may [...]","og_url":"https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2017-07-06T12:06:37+00:00","article_modified_time":"2021-07-16T14:27:13+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2017\/07\/pom_structure.jpg","type":"","width":"","height":""}],"author":"Himanshu Chand","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Himanshu Chand","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/"},"author":{"name":"Himanshu Chand","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/08d4d0b31f228925099740afd668b50f"},"headline":"Page Object Model (POM) in Selenium","datePublished":"2017-07-06T12:06:37+00:00","dateModified":"2021-07-16T14:27:13+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/"},"wordCount":437,"commentCount":1,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2017\/07\/pom_structure.jpg","keywords":["Page Object Model","POM","Selenium","Selenium POM"],"articleSection":["Automation testing","Testing"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/","url":"https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/","name":"Page Object Model (POM) in Selenium - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2017\/07\/pom_structure.jpg","datePublished":"2017-07-06T12:06:37+00:00","dateModified":"2021-07-16T14:27:13+00:00","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/pom_structure.jpg","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/pom_structure.jpg","width":429,"height":258,"caption":"project structure"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/page-object-model-pom-selenium\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Page Object Model (POM) in Selenium"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/08d4d0b31f228925099740afd668b50f","name":"Himanshu Chand","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/067d10770fdcc86d177164f68eb74b9528397b3a5fbf01970b6f6dfd48c64281?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/067d10770fdcc86d177164f68eb74b9528397b3a5fbf01970b6f6dfd48c64281?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Himanshu Chand"},"url":"https:\/\/webkul.com\/blog\/author\/himanshu-chand168\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/88434","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/94"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=88434"}],"version-history":[{"count":4,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/88434\/revisions"}],"predecessor-version":[{"id":296763,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/88434\/revisions\/296763"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=88434"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=88434"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=88434"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}