{"id":97446,"date":"2019-09-03T07:00:50","date_gmt":"2019-09-03T04:00:50","guid":{"rendered":"https:\/\/www.javacodegeeks.com\/?p=97446"},"modified":"2019-09-02T13:36:21","modified_gmt":"2019-09-02T10:36:21","slug":"selenium-scripting-tips-tricks","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2019\/09\/selenium-scripting-tips-tricks.html","title":{"rendered":"Selenium Scripting Tips and Tricks"},"content":{"rendered":"<p>If you have just started learning selenium then the below tricks and tips will act as a saviour. These tips and tricks have all the basic things which you might forget and it will help you in remembering all those. You can just go through them once and you will get to know everything in few seconds. Let\u2019s have a look at all the tricks and tips one by one.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"1024\" height=\"683\" src=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/09\/photo-1517148815978-75f6acaaf32c-1024x683.jpg\" alt=\"\" class=\"wp-image-97452\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/09\/photo-1517148815978-75f6acaaf32c-1024x683.jpg 1024w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/09\/photo-1517148815978-75f6acaaf32c-300x200.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/09\/photo-1517148815978-75f6acaaf32c-768x512.jpg 768w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/09\/photo-1517148815978-75f6acaaf32c.jpg 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n<ul class=\"wp-block-list\">\n<li><b>Best Way to Create Webdriver&nbsp;Instance<\/b><\/li>\n<\/ul>\n<p>You can make your tests generic. First step would be initializing the browser by passing the value from the configuration file. You can have one key as browser and value as Chrome, Firefox or IE. You can then initialize the browser according to the value passed there. Let\u2019s look at the code which will be involved.Add paragraph text here.<\/p>\n<pre class=\"brush:java\">\npublic static WebDriver getBrowser(String browserName)\n{\nIf(driver == null)\n{\nif(browserName.equals(\u201cfirefox\u201d))\n{\ndriver = new FirefoxDriver();\n}\nelse if(browserName.equals(\u201cChrome\u201d))\n{\ndriver=new ChromeDriver();\n}\nelse if(browserName.contains(\u201cIE\u201d))\n{\ndriver=new InternetExplorerDriver();\n}\n}\nreturn driver;\n}\n<\/pre>\n<ul class=\"wp-block-list\">\n<li><strong>Best Way To Check If An Element Exists Or Not<\/strong><\/li>\n<\/ul>\n<p>If you have to check whether an element exist in the web application or not, you can easily do it by getting the size of the web element and then check if it is greater than zero or not.<\/p>\n<p><strong>Boolean isElementExists = driver.findElements(By.xpath(\u201c\u201d)).size()&gt;0<\/strong><\/p>\n<ul class=\"wp-block-list\">\n<li><strong>How To Wait For Page To Load Completely?<\/strong><\/li>\n<\/ul>\n<p>Sometimes, a page takes some time to load and you have to then wait for the time till the page is loaded completely. For this, you have to first check if it is loaded properly and then you can do any other operation on it. You can use Javascriptexecutor to check if the page is loaded completely or not.<\/p>\n<pre class=\"brush:java\">\nwait.until(new Predicate &lt; WebDriver &gt; () {\n\n@Override\n\npublic Boolean waitPageLoaded(WebDriver driver) {\n\nreturn ((JavascriptExecutor) driver).executeScript(\"return document.readyState\").equals(\"complete\");\n\n}\n\n});\n<\/pre>\n<ul class=\"wp-block-list\">\n<li><b>How To Take A Screenshot Using Selenium <\/b><b>Webdriver<\/b><b>?<\/b><\/li>\n<\/ul>\n<p>Sometimes, it is very important to take screenshots while execution to know what went wrong. It is damn say to do it with selenium. You can have selenium driver and then you can cast it to takes Screenshot interface. Make an instance of it and then use it to get the screenshot. You can use kits method .getScreenshotAs and then you can specify in which format you are expecting your screenshots to be.<\/p>\n<p><strong>\/\/ Storing the screenshot in current project directory<\/strong><\/p>\n<p>String screenShot = System.getProperty(&#8220;user.dir&#8221;) + &#8220;\\\\screenshottest.png&#8221;;<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p><strong>\/\/casting Webdriver to take the screenshot<\/strong><\/p>\n<p>File srcFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);<\/p>\n<p><strong>\/\/ Saving the screenshot<\/strong><\/p>\n<p>FileUtils.copyFile(srcFile, new File(screenShot));<\/p>\n<ul class=\"wp-block-list\">\n<li><b>How To Get HTML Source Of Web Element In Selenium <\/b><b>Webdriver<\/b><b>?<\/b><\/li>\n<\/ul>\n<p>Selenium WebDriver provides you one method named getAttribute which will allow you to get inner HTML of a web element. You can do it by getting the element first. Afterwards, you can use getAttribute to get the innerHTML of a web element.<\/p>\n<p><strong>String html = element.getAttribute(&#8220;innerHTML&#8221;);<\/strong><\/p>\n<ul class=\"wp-block-list\">\n<li><strong>How To Select Dropdown Options Using Select Class?<\/strong><\/li>\n<\/ul>\n<p>In selenium, if you encounter any dropdown then you can select any option in it using select class. There are many ways by which you can select an option. Some of the ways include selecting by text, index and values.<\/p>\n<pre class=\"brush:java\">\nSelect drp= new Select(Driver.findElement(By.xpath(\u201c\u201d));\n\ndrp.deselectAll();\n\ndrp.selectByVisibleText(\"selectLabel\");\n<\/pre>\n<ul class=\"wp-block-list\">\n<li><b>How To Refresh Web Page In <\/b><b>Webdriver<\/b><b>?<\/b><\/li>\n<\/ul>\n<p>If you want to refresh the page then you can use navigate () method of selenium web driver. You can then refresh() method to actually refresh the page so that all elements will be initlitzed from the starting.<\/p>\n<p><strong>driver.navigate().refresh();<\/strong><\/p>\n<ul class=\"wp-block-list\">\n<li><b>How To Switch To New Tab Using Selenium <\/b><b>Webdriver<\/b><b>?<\/b><\/li>\n<\/ul>\n<p>You can easily switch to new tab using selenium webdriver. First thing to keep in mind is to use .getWindowHandles() and then you can switch to the first index of the array list having all the window handles.<\/p>\n<pre class=\"brush:java\">\nArrayList&lt;String&gt; tabs = new ArrayList&lt;String&gt; (driver.getWindowHandles());\n\ndriver.switchTo().window(tabs.get(0));\n<\/pre>\n<ul class=\"wp-block-list\">\n<li><b>How to Set Driver Executable Path in <\/b><b>Webdriver<\/b><b>?<\/b><\/li>\n<\/ul>\n<p>For browsers, chrome and i.e., you have to see path for the driver executables. For setting the path you have to use System.setProperty method in selenium. Let\u2019s see how it looks.<\/p>\n<pre class=\"brush:java\">\nFile ieDriverPath = new File(\"path\/\/iexploredriver.exe\");\n\nSystem.setProperty(\"webdriver.ie.driver\", ieDriverPath.getAbsolutePath());\n\nWebDriver driver = new InternetExplorerDriver();\n<\/pre>\n<ul class=\"wp-block-list\">\n<li><strong>How to Switch To New Popup Window? <\/strong><\/li>\n<\/ul>\n<p>If you want to switch to a specific window which is opened then you can first getAllWindowHandles() and then switch using method driver.switchTo().<\/p>\n<pre class=\"brush:java\">\n\/ Get the current window handle.\n\nString hBefore = driver.getWindowHandle();\n\n\/\/ action which opens lot of windows.\n\n\/\/ Switch to new windows.\n\nfor(String hNew: driver.getWindowHandles()){\n\ndriver.switchTo().window(hNew);\n\n}\n\n\/\/ Close all new windows.\n\ndriver.close();\n\n\/\/ Switch back to first window.\n\ndriver.switchTo().window(hBefore);\n<\/pre>\n<p>But if in case, you want to specifically switch to a particular window. You can get a web element and see the visibility of it in a particular window. If it is present, then you can switch to it.<\/p>\n<pre class=\"brush:java\">\n\/ Get the current window handle.\n\nString hBefore = driver.getWindowHandle();\n\n\/\/ Click to open new windows.\n\n\/\/ Switch to window which has a webelement attached to it\n\nfor(String hNew: driver.getWindowHandles()){\n\nIf(driver.findElements(By.xpath(\u201c\u201d)).size()&gt;0)\n\n{\n\ndriver.switchTo().window(hNew);\n\n}\n\n}\n\n\/\/ Close all new windows.\n\ndriver.close();\n\n\/\/ Switch back to first window.\n\ndriver.switchTo().window(hBefore);\n<\/pre>\n<ul class=\"wp-block-list\">\n<li><strong>How to Click On a Checkbox Which Isn\u2019t Visible?<\/strong><\/li>\n<\/ul>\n<p>There are many instances when the checkbox you want to click isn\u2019t visible and unfortunately you won\u2019t be able to click on it. You have to first enable it so that you can actually click on it. If you won\u2019t enable it then you would get exception like \u201cElement is not currently visible and so may not be interacted with.&#8221;<\/p>\n<p>Java script executor can be used to enable it so that selenium can click on it. Code snippet is below:<\/p>\n<pre class=\"brush:java\">\n((JavascriptExecutor)driver).executeScript(\"arguments[0].checked = true;\", checkbox);\n<\/pre>\n<ul class=\"wp-block-list\">\n<li><strong>How to Do Mouseover Action in Selenium Webdriver? &nbsp;<\/strong><\/li>\n<\/ul>\n<p>If you want to mouse over a web element, you can use Actions() class to handle it. You can use function moveToElemenet() and then build() and perform() in a sequence to perform mouse hovering action on a web element.<\/p>\n<pre class=\"brush:java\">\nActions action = new Actions(driver);\n\nWebElement item = driver.findElement(By.xpath(\"\"));\n\naction.moveToElement(item).moveToElement(driver.findElement(By.xpath(\"\")) ).click().build().perform();\n<\/pre>\n<ul class=\"wp-block-list\">\n<li><strong>How to Delete Cookies before Running a Test Script? <\/strong><\/li>\n<\/ul>\n<p>Sometimes it is very important to clear all the cookies before running your test scripts. You can use method DeleteAllCookies function of driver.manage().<\/p>\n<p>The code snippet is as below:<\/p>\n<p><strong>this.driver.Manage().Cookies.DeleteAllCookies();<\/strong><\/p>\n<p>Also, if you have a cookie which is having a particular name then you can delete it using method: DeleteCookiesNames of manage() class.<\/p>\n<p><strong>this.driver.Manage().Cookies.DeleteCookieNamed(&#8220;CookieName&#8221;);<\/strong><\/p>\n<ul class=\"wp-block-list\">\n<li><strong>How to Maximize the Window in the Test Script?<\/strong><\/li>\n<\/ul>\n<p>Sometimes, you need to test the scripts in full window size and resolution. You can easily do it by using manage () method of driver instance. You can then use method window() and then maximize() to take the window to the maximum size.<\/p>\n<p>Code snippet is as below:<\/p>\n<pre class=\"brush:java\">\npublic void MaximizeWindow()\n\n{\n\nthis.driver.get(\u201c\");\n\nthis.driver.Manage().Window().Maximize();\n\n}\n<\/pre>\n<h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2>\n<p>So, there are some important tricks and tips which you can follow to run your selenium tests. If you will keep these in mind, you will solve majority of your problems while scripting in Automation Testing. So, use them and save your time. All the best!!<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td>\n<p>Published on Java Code Geeks with permission by Nexsoftsys, partner at our <a href=\"\/\/www.javacodegeeks.com\/join-us\/jcg\/\" target=\"_blank\" rel=\"noopener noreferrer\">JCG program<\/a>. See the original article here: <a href=\"http:\/\/softwaretestingsolution.mystrikingly.com\/blog\/selenium-scripting-tips-and-tricks\" target=\"_blank\" rel=\"noopener noreferrer\">Selenium Scripting Tips and Tricks<\/a><\/p>\n<p>Opinions expressed by Java Code Geeks contributors are their own.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>If you have just started learning selenium then the below tricks and tips will act as a saviour. These tips and tricks have all the basic things which you might forget and it will help you in remembering all those. You can just go through them once and you will get to know everything in &hellip;<\/p>\n","protected":false},"author":100728,"featured_media":231,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[287],"class_list":["post-97446","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-selenium"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Selenium Scripting Tips and Tricks - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Interested to learn about Selenium Scripting Tips? Check our article presenting some Selenium Scripting Tips and Tricks that will save you time\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2019\/09\/selenium-scripting-tips-tricks.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Selenium Scripting Tips and Tricks - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Interested to learn about Selenium Scripting Tips? Check our article presenting some Selenium Scripting Tips and Tricks that will save you time\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2019\/09\/selenium-scripting-tips-tricks.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/people\/Divyesh-Aegis\/100008181751808\" \/>\n<meta property=\"article:published_time\" content=\"2019-09-03T04:00:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/selenium-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Divyesh Aegis\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@divyeshaegis\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Divyesh Aegis\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/09\\\/selenium-scripting-tips-tricks.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/09\\\/selenium-scripting-tips-tricks.html\"},\"author\":{\"name\":\"Divyesh Aegis\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/878b691b2b44f47910b00c417b480e56\"},\"headline\":\"Selenium Scripting Tips and Tricks\",\"datePublished\":\"2019-09-03T04:00:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/09\\\/selenium-scripting-tips-tricks.html\"},\"wordCount\":1049,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/09\\\/selenium-scripting-tips-tricks.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/selenium-logo.jpg\",\"keywords\":[\"Selenium\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/09\\\/selenium-scripting-tips-tricks.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/09\\\/selenium-scripting-tips-tricks.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/09\\\/selenium-scripting-tips-tricks.html\",\"name\":\"Selenium Scripting Tips and Tricks - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/09\\\/selenium-scripting-tips-tricks.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/09\\\/selenium-scripting-tips-tricks.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/selenium-logo.jpg\",\"datePublished\":\"2019-09-03T04:00:50+00:00\",\"description\":\"Interested to learn about Selenium Scripting Tips? Check our article presenting some Selenium Scripting Tips and Tricks that will save you time\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/09\\\/selenium-scripting-tips-tricks.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/09\\\/selenium-scripting-tips-tricks.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/09\\\/selenium-scripting-tips-tricks.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/selenium-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/selenium-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/09\\\/selenium-scripting-tips-tricks.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Selenium Scripting Tips and Tricks\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/878b691b2b44f47910b00c417b480e56\",\"name\":\"Divyesh Aegis\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f732e9c6f6c3d55257d2871195aa1ce7a6b0141d77a31532ecb281215b0b49a4?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f732e9c6f6c3d55257d2871195aa1ce7a6b0141d77a31532ecb281215b0b49a4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f732e9c6f6c3d55257d2871195aa1ce7a6b0141d77a31532ecb281215b0b49a4?s=96&d=mm&r=g\",\"caption\":\"Divyesh Aegis\"},\"description\":\"Divyesh Aegis is a senior Java developer and writer for working with NEX \u2013 leading mobile and web Development Company in USA. You can contact his in order to hire digital marketing to avail the highly functional mobile and web development solutions. He has several years of experience in the field of Java Development.\",\"sameAs\":[\"http:\\\/\\\/softwaretestingsolution.mystrikingly.com\\\/\",\"https:\\\/\\\/www.facebook.com\\\/people\\\/Divyesh-Aegis\\\/100008181751808\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/divyesh-aegis-3b469396\\\/?originalSubdomain=in\",\"https:\\\/\\\/x.com\\\/divyeshaegis\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/divyesh-aegis\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Selenium Scripting Tips and Tricks - Java Code Geeks","description":"Interested to learn about Selenium Scripting Tips? Check our article presenting some Selenium Scripting Tips and Tricks that will save you time","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:\/\/www.javacodegeeks.com\/2019\/09\/selenium-scripting-tips-tricks.html","og_locale":"en_US","og_type":"article","og_title":"Selenium Scripting Tips and Tricks - Java Code Geeks","og_description":"Interested to learn about Selenium Scripting Tips? Check our article presenting some Selenium Scripting Tips and Tricks that will save you time","og_url":"https:\/\/www.javacodegeeks.com\/2019\/09\/selenium-scripting-tips-tricks.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_author":"https:\/\/www.facebook.com\/people\/Divyesh-Aegis\/100008181751808","article_published_time":"2019-09-03T04:00:50+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/selenium-logo.jpg","type":"image\/jpeg"}],"author":"Divyesh Aegis","twitter_card":"summary_large_image","twitter_creator":"@divyeshaegis","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Divyesh Aegis","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2019\/09\/selenium-scripting-tips-tricks.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/09\/selenium-scripting-tips-tricks.html"},"author":{"name":"Divyesh Aegis","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/878b691b2b44f47910b00c417b480e56"},"headline":"Selenium Scripting Tips and Tricks","datePublished":"2019-09-03T04:00:50+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/09\/selenium-scripting-tips-tricks.html"},"wordCount":1049,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/09\/selenium-scripting-tips-tricks.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/selenium-logo.jpg","keywords":["Selenium"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2019\/09\/selenium-scripting-tips-tricks.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2019\/09\/selenium-scripting-tips-tricks.html","url":"https:\/\/www.javacodegeeks.com\/2019\/09\/selenium-scripting-tips-tricks.html","name":"Selenium Scripting Tips and Tricks - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/09\/selenium-scripting-tips-tricks.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/09\/selenium-scripting-tips-tricks.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/selenium-logo.jpg","datePublished":"2019-09-03T04:00:50+00:00","description":"Interested to learn about Selenium Scripting Tips? Check our article presenting some Selenium Scripting Tips and Tricks that will save you time","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/09\/selenium-scripting-tips-tricks.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2019\/09\/selenium-scripting-tips-tricks.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2019\/09\/selenium-scripting-tips-tricks.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/selenium-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/selenium-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2019\/09\/selenium-scripting-tips-tricks.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Selenium Scripting Tips and Tricks"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/878b691b2b44f47910b00c417b480e56","name":"Divyesh Aegis","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/f732e9c6f6c3d55257d2871195aa1ce7a6b0141d77a31532ecb281215b0b49a4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f732e9c6f6c3d55257d2871195aa1ce7a6b0141d77a31532ecb281215b0b49a4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f732e9c6f6c3d55257d2871195aa1ce7a6b0141d77a31532ecb281215b0b49a4?s=96&d=mm&r=g","caption":"Divyesh Aegis"},"description":"Divyesh Aegis is a senior Java developer and writer for working with NEX \u2013 leading mobile and web Development Company in USA. You can contact his in order to hire digital marketing to avail the highly functional mobile and web development solutions. He has several years of experience in the field of Java Development.","sameAs":["http:\/\/softwaretestingsolution.mystrikingly.com\/","https:\/\/www.facebook.com\/people\/Divyesh-Aegis\/100008181751808","https:\/\/www.linkedin.com\/in\/divyesh-aegis-3b469396\/?originalSubdomain=in","https:\/\/x.com\/divyeshaegis"],"url":"https:\/\/www.javacodegeeks.com\/author\/divyesh-aegis"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/97446","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/100728"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=97446"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/97446\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/231"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=97446"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=97446"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=97446"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}