{"id":4273,"date":"2021-04-20T04:32:10","date_gmt":"2021-04-20T04:32:10","guid":{"rendered":"https:\/\/studysection.com\/blog\/?p=4273"},"modified":"2021-04-20T04:46:05","modified_gmt":"2021-04-20T04:46:05","slug":"chromeoptions-class-common-arguments-and-methods","status":"publish","type":"post","link":"https:\/\/studysection.com\/blog\/chromeoptions-class-common-arguments-and-methods\/","title":{"rendered":"ChromeOptions Class (Common Arguments and Methods)"},"content":{"rendered":"<p>ChromeOptions(Common Arguments and Methods) is a separate class in selenium that helps to manage options specific to the ChromeDriver. ChromeOptions is a class that extends MutableCapabilities. It was introduced with Selenium v3.6.0. <\/p>\n<p><strong>Why It is Required:<\/strong> ChromeOptions class is used to customize the settings of the chrome browser. We can disable-popup-blocking, make-default-browser, disable-extensions, incognito, check the version, and other changes to the browser using this class with the latest version selenium. By default, selenium starts with a fresh session of a browser that doesn&#8217;t have any settings, cookies, and history.<\/p>\n<h2>Frequently Used Methods and Arguments:<\/h2>\n<ol>\n<li><strong>start-maximized:<\/strong> This argument opens the chrome browser window in maximize mode.<\/li>\n<li><strong>setPageLoadStrategy<\/strong>: This method is used to speed up execution. It is of three types <strong>Normal, None, and Eager<\/strong>.\n<ul>\n<li><strong>Normal:<\/strong> In this mode, Selenium WebDriver wait for the entire page is loaded.<\/li>\n<li><strong>None:<\/strong>  In this mode, Selenium WebDriver only waits until the initial page is downloaded.<\/li>\n<li><strong>Eager:<\/strong> <a href=\"https:\/\/studysection.com\/blog\/selenium-basic-overview\/\">Selenium<\/a> WebDriver to wait until the initial HTML document has been completely loaded and parsed<\/li>\n<\/ul>\n<\/li>\n<li><strong>disable-infobars:<\/strong> This argument is used to remove the information bar\/notifications from the browser. But this argument has been deprecated. We can use this line of code to remove the information bar from the browser.<br \/>\n<code>Code: options.setExperimentalOption(\"excludeSwitches\", new String[]{\"enable-automation\"});<\/code><br \/>\n<img decoding=\"async\" src=\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/04\/infobar.png\" alt=\"infobar | Arguments\"\/><br \/>\n<img decoding=\"async\" src=\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/04\/without-infobar.png\" alt=\" Arguments|without-infobar\"\/>\n<\/li>\n<li><strong>Incognito:<\/strong> This argument is used to open a chrome browser in incognito mode. It helps to prevent history and cookies. Incognito mode deletes this data as soon as we close the web browser.<br \/>\n<img decoding=\"async\" src=\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/04\/map.png\" alt=\"map | Arguments\"\/>\n<\/li>\n<li><strong>Version:<\/strong> This argument is used to get the current version of the browser.<\/li>\n<li><strong>Disable-popup-blocking:<\/strong> This argument is used to disable the popup in the chrome browser. We can block the popup using these methods:<br \/>\n<strong>Code:<\/strong> <em>options.setExperimentalOption(&#8220;excludeSwitches&#8221;,<br \/>\nArrays.asList(&#8220;disable-popup-blocking&#8221;));<\/em><\/p>\n<p><strong>Code:<\/strong> <em>options.addArguments(&#8220;&#8211;disable-popup-blocking&#8221;);<\/em><br \/>\n<img decoding=\"async\" src=\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/04\/alert.png\" alt=\"Arguments |alert\"\/><br \/>\n<strong>Code:<\/strong><br \/>\n<code style=\"color:blue;\"><em>package Practise;<br \/>\nimport java.util.Arrays;<br \/>\nimport org.openqa.selenium.By;<br \/>\nimport org.openqa.selenium.PageLoadStrategy;<br \/>\nimport org.openqa.selenium.WebDriver;<br \/>\nimport org.openqa.selenium.chrome.ChromeDriver;<br \/>\nimport org.openqa.selenium.chrome.ChromeOptions;<br \/>\nimport io.github.bonigarcia.wdm.managers.ChromeDriverManager;<br \/>\npublic class Testing{<br \/>\n\tpublic static WebDriver driver;<br \/>\n\t\tpublic static void main(String  arg[]) throws InterruptedException{<br \/>\n\t\t\tChromeDriverManager.chromedriver().setup();<br \/>\n\t\t\t\/\/ Creating ChromeOptions object<br \/>\n\t\t\tChromeOptions options = new ChromeOptions();<br \/>\n\t\t\t\/\/ 1. Open browser window in maximize mode<br \/>\n\t\t\toptions.addArguments(\"--start-maximized\");<br \/>\n\t\t\t\/\/ 2. Add page load strategy<br \/>\n\t\t\toptions.setPageLoadStrategy(PageLoadStrategy.EAGER);<br \/>\n\t\t\t\/\/ 3. Remove Infobars<br \/>\n\t\t\toptions.setExperimentalOption(\"excludeSwitches\", new String[]{\"enable-automation\"});<br \/>\n\t\t\t\/\/ 4. Open browser in Incognito mode<br \/>\n\t\t\toptions.addArguments(\"--incognito\");<br \/>\n\t\t\t\/\/ 5. Get current Version of Chrome<br \/>\n\t\t\toptions.addArguments(\"--version\");<br \/>\n\t\t\t\/\/ 6. Disable-popup-blocking<br \/>\n\t\t\t\/\/options.setExperimentalOption(\"excludeSwitches\",<br \/>\n\t\t\t\/\/Arrays.asList(\"disable-popup-blocking\"));<br \/>\n\t\t\toptions.addArguments(\"--disable-popup-blocking\");<br \/>\n\t\t\t\/\/ For use with ChromeDriver<br \/>\n\t\t\tdriver = new ChromeDriver(options);<br \/>\n\t\t\t\/\/Open URL<br \/>\n\t\t\tdriver.get(\"https:\/\/www.google.com\/maps\");<br \/>\n\t\t\tThread.sleep(5000);<br \/>\n\t\t\tdriver.findElement(By.xpath(\"\/\/*[@id='widget-mylocation']\")).click();<br \/>\n\t\t}<br \/>\n}<\/em><\/code>\n<\/li>\n<\/ol>\n<p><small><em>Knowledge of .NET is quite rewarding in the IT industry. If you have got some skills in the .NET framework then a <a href=\"https:\/\/www.studysection.com\/vb-net-web-developer-advanced-diploma\">.NET Certification Exams<\/a> from StudySection can prove to be a good attachment with your resume. You can go for a foundation level certificate as well as an advanced level certificate in the .NET framework.<\/em><\/small><\/p>\n","protected":false},"excerpt":{"rendered":"<p>ChromeOptions(Common Arguments and Methods) is a separate class in selenium that helps to manage options specific to the ChromeDriver. ChromeOptions<\/p>\n","protected":false},"author":1,"featured_media":4279,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[652],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>ChromeOptions Class (Common Arguments and Methods) - SS Blog<\/title>\n<meta name=\"description\" content=\"ChromeOptions(Common Arguments and Methods) is a separate class in selenium that helps to manage options specific to the ChromeDriver.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/studysection.com\/blog\/chromeoptions-class-common-arguments-and-methods\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ChromeOptions Class (Common Arguments and Methods) - SS Blog\" \/>\n<meta property=\"og:description\" content=\"ChromeOptions(Common Arguments and Methods) is a separate class in selenium that helps to manage options specific to the ChromeDriver.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/studysection.com\/blog\/chromeoptions-class-common-arguments-and-methods\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog Posts on famous people, innovations and educational topics\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/studysection\" \/>\n<meta property=\"article:published_time\" content=\"2021-04-20T04:32:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-04-20T04:46:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/04\/chrome.png\" \/>\n\t<meta property=\"og:image:width\" content=\"300\" \/>\n\t<meta property=\"og:image:height\" content=\"200\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"admin-studysection-blog\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@studysection\" \/>\n<meta name=\"twitter:site\" content=\"@studysection\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin-studysection-blog\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/studysection.com\/blog\/chromeoptions-class-common-arguments-and-methods\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/studysection.com\/blog\/chromeoptions-class-common-arguments-and-methods\/\"},\"author\":{\"name\":\"admin-studysection-blog\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402\"},\"headline\":\"ChromeOptions Class (Common Arguments and Methods)\",\"datePublished\":\"2021-04-20T04:32:10+00:00\",\"dateModified\":\"2021-04-20T04:46:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/studysection.com\/blog\/chromeoptions-class-common-arguments-and-methods\/\"},\"wordCount\":344,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/studysection.com\/blog\/#organization\"},\"keywords\":[\"ChromeOptions\"],\"articleSection\":[\"Learn and Grow\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/studysection.com\/blog\/chromeoptions-class-common-arguments-and-methods\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/studysection.com\/blog\/chromeoptions-class-common-arguments-and-methods\/\",\"url\":\"https:\/\/studysection.com\/blog\/chromeoptions-class-common-arguments-and-methods\/\",\"name\":\"ChromeOptions Class (Common Arguments and Methods) - SS Blog\",\"isPartOf\":{\"@id\":\"https:\/\/studysection.com\/blog\/#website\"},\"datePublished\":\"2021-04-20T04:32:10+00:00\",\"dateModified\":\"2021-04-20T04:46:05+00:00\",\"description\":\"ChromeOptions(Common Arguments and Methods) is a separate class in selenium that helps to manage options specific to the ChromeDriver.\",\"breadcrumb\":{\"@id\":\"https:\/\/studysection.com\/blog\/chromeoptions-class-common-arguments-and-methods\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/studysection.com\/blog\/chromeoptions-class-common-arguments-and-methods\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/studysection.com\/blog\/chromeoptions-class-common-arguments-and-methods\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/studysection.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ChromeOptions Class (Common Arguments and Methods)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/studysection.com\/blog\/#website\",\"url\":\"https:\/\/studysection.com\/blog\/\",\"name\":\"Blog Posts on famous people, innovations and educational topics\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/studysection.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/studysection.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/studysection.com\/blog\/#organization\",\"name\":\"StudySection\",\"url\":\"https:\/\/studysection.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png\",\"contentUrl\":\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png\",\"width\":920,\"height\":440,\"caption\":\"StudySection\"},\"image\":{\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/studysection\",\"https:\/\/twitter.com\/studysection\",\"https:\/\/www.instagram.com\/study.section\/\",\"https:\/\/www.linkedin.com\/company\/studysection\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402\",\"name\":\"admin-studysection-blog\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g\",\"caption\":\"admin-studysection-blog\"},\"url\":\"https:\/\/studysection.com\/blog\/author\/admin-studysection-blog\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"ChromeOptions Class (Common Arguments and Methods) - SS Blog","description":"ChromeOptions(Common Arguments and Methods) is a separate class in selenium that helps to manage options specific to the ChromeDriver.","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:\/\/studysection.com\/blog\/chromeoptions-class-common-arguments-and-methods\/","og_locale":"en_US","og_type":"article","og_title":"ChromeOptions Class (Common Arguments and Methods) - SS Blog","og_description":"ChromeOptions(Common Arguments and Methods) is a separate class in selenium that helps to manage options specific to the ChromeDriver.","og_url":"https:\/\/studysection.com\/blog\/chromeoptions-class-common-arguments-and-methods\/","og_site_name":"Blog Posts on famous people, innovations and educational topics","article_publisher":"https:\/\/www.facebook.com\/studysection","article_published_time":"2021-04-20T04:32:10+00:00","article_modified_time":"2021-04-20T04:46:05+00:00","og_image":[{"width":300,"height":200,"url":"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/04\/chrome.png","type":"image\/png"}],"author":"admin-studysection-blog","twitter_card":"summary_large_image","twitter_creator":"@studysection","twitter_site":"@studysection","twitter_misc":{"Written by":"admin-studysection-blog","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/studysection.com\/blog\/chromeoptions-class-common-arguments-and-methods\/#article","isPartOf":{"@id":"https:\/\/studysection.com\/blog\/chromeoptions-class-common-arguments-and-methods\/"},"author":{"name":"admin-studysection-blog","@id":"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402"},"headline":"ChromeOptions Class (Common Arguments and Methods)","datePublished":"2021-04-20T04:32:10+00:00","dateModified":"2021-04-20T04:46:05+00:00","mainEntityOfPage":{"@id":"https:\/\/studysection.com\/blog\/chromeoptions-class-common-arguments-and-methods\/"},"wordCount":344,"commentCount":0,"publisher":{"@id":"https:\/\/studysection.com\/blog\/#organization"},"keywords":["ChromeOptions"],"articleSection":["Learn and Grow"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/studysection.com\/blog\/chromeoptions-class-common-arguments-and-methods\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/studysection.com\/blog\/chromeoptions-class-common-arguments-and-methods\/","url":"https:\/\/studysection.com\/blog\/chromeoptions-class-common-arguments-and-methods\/","name":"ChromeOptions Class (Common Arguments and Methods) - SS Blog","isPartOf":{"@id":"https:\/\/studysection.com\/blog\/#website"},"datePublished":"2021-04-20T04:32:10+00:00","dateModified":"2021-04-20T04:46:05+00:00","description":"ChromeOptions(Common Arguments and Methods) is a separate class in selenium that helps to manage options specific to the ChromeDriver.","breadcrumb":{"@id":"https:\/\/studysection.com\/blog\/chromeoptions-class-common-arguments-and-methods\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/studysection.com\/blog\/chromeoptions-class-common-arguments-and-methods\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/studysection.com\/blog\/chromeoptions-class-common-arguments-and-methods\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/studysection.com\/blog\/"},{"@type":"ListItem","position":2,"name":"ChromeOptions Class (Common Arguments and Methods)"}]},{"@type":"WebSite","@id":"https:\/\/studysection.com\/blog\/#website","url":"https:\/\/studysection.com\/blog\/","name":"Blog Posts on famous people, innovations and educational topics","description":"","publisher":{"@id":"https:\/\/studysection.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/studysection.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/studysection.com\/blog\/#organization","name":"StudySection","url":"https:\/\/studysection.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png","contentUrl":"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png","width":920,"height":440,"caption":"StudySection"},"image":{"@id":"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/studysection","https:\/\/twitter.com\/studysection","https:\/\/www.instagram.com\/study.section\/","https:\/\/www.linkedin.com\/company\/studysection"]},{"@type":"Person","@id":"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402","name":"admin-studysection-blog","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/studysection.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g","caption":"admin-studysection-blog"},"url":"https:\/\/studysection.com\/blog\/author\/admin-studysection-blog\/"}]}},"views":2082,"_links":{"self":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts\/4273"}],"collection":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/comments?post=4273"}],"version-history":[{"count":3,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts\/4273\/revisions"}],"predecessor-version":[{"id":4281,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts\/4273\/revisions\/4281"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/media\/4279"}],"wp:attachment":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/media?parent=4273"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/categories?post=4273"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/tags?post=4273"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}