{"id":803,"date":"2013-01-02T07:53:46","date_gmt":"2013-01-02T07:53:46","guid":{"rendered":"http:\/\/vskills.in\/certification\/tutorial\/?p=803"},"modified":"2024-04-12T14:13:13","modified_gmt":"2024-04-12T08:43:13","slug":"selenium-ide-locating-elements","status":"publish","type":"page","link":"https:\/\/www.vskills.in\/certification\/tutorial\/selenium-ide-locating-elements\/","title":{"rendered":"Selenium IDE | Locating the Elements"},"content":{"rendered":"\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a ref=\"magnificPopup\" href=\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2020\/12\/Certified-Selenium-Professional-15.png\"><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"400\" src=\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2020\/12\/Certified-Selenium-Professional-15.png\" alt=\"Locating the Elements\" class=\"wp-image-93460\" srcset=\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2020\/12\/Certified-Selenium-Professional-15.png 750w, https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2020\/12\/Certified-Selenium-Professional-15-300x160.png 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/a><\/figure><\/div>\n\n\n<h3><strong>Selenium IDE | Locating the Elements<\/strong><\/h3>\n<p>For many <strong>Selenium IDE<\/strong> commands, a target is required. This target identifies an element in the content of the web application and consists of the location strategy followed by the location in the format <strong>locatorType=location.<\/strong> The locator type can be omitted in many cases. One of the most fundamental techniques to learn when using WebDriver is how to find elements on the page. Let&#8217;s get started<\/p>\n<p>The various locator types are explained below with examples for each.<\/p>\n<ul>\n<li><strong>Locating by Identifier: <\/strong>This is probably the most common method of locating elements and is the catch-all default when no recognized locator type is used With this strategy, the first element with the id attribute value matching the location will be used. If no element has a matching id attribute, then the first element with a name attribute matching the location will be used.<\/li>\n<\/ul>\n<p>For instance, page source could have id and name attributes as follows:<\/p>\n<p>&lt;html&gt;<\/p>\n<p>&lt;body&gt;<\/p>\n<p>&lt;form id=&#8221;loginForm&#8221;&gt;<\/p>\n<p>&lt;input name=&#8221;username&#8221; type=&#8221;text&#8221; \/&gt;<\/p>\n<p>&lt;input name=&#8221;password&#8221; type=&#8221;password&#8221; \/&gt;<\/p>\n<p>&lt;input name=&#8221;continue&#8221; type=&#8221;submit&#8221; value=&#8221;Login&#8221; \/&gt;<\/p>\n<p>&lt;\/form&gt;<\/p>\n<p>&lt;\/body&gt;<\/p>\n<p>&lt;html&gt;<\/p>\n<p>The following locator strategies would return the elements from the HTML snippet above indicated by line number:<\/p>\n<ul>\n<li>identifier=loginForm (3)<\/li>\n<li>identifier=password (5)<\/li>\n<li>identifier=continue (6)<\/li>\n<li>continue (6)<\/li>\n<\/ul>\n<p>Since the identifier type of locator is the default, the identifier, in the first three examples above is not necessary.<\/p>\n<ul>\n<li><strong>Locating by Id: <\/strong>This type of locator is more limited than the identifier locator type, but also more explicit. Use this when you know an element\u2019s id attribute.<\/li>\n<\/ul>\n<p>&lt;html&gt;<\/p>\n<p>&lt;body&gt;<\/p>\n<p>&lt;form id=&#8221;loginForm&#8221;&gt;<\/p>\n<p>&lt;input name=&#8221;username&#8221; type=&#8221;text&#8221; \/&gt;<\/p>\n<p>&lt;input name=&#8221;password&#8221; type=&#8221;password&#8221; \/&gt;<\/p>\n<p>&lt;input name=&#8221;continue&#8221; type=&#8221;submit&#8221; value=&#8221;Login&#8221; \/&gt;<\/p>\n<p>&lt;input name=&#8221;continue&#8221; type=&#8221;button&#8221; value=&#8221;Clear&#8221; \/&gt;<\/p>\n<p>&lt;\/form&gt;<\/p>\n<p>&lt;\/body&gt;<\/p>\n<p>&lt;html&gt;<\/p>\n<p>id=loginForm (3)<\/p>\n<ul>\n<li><strong>Locating by Name: <\/strong>The name locator type will locate the first element with a matching name attribute. If multiple elements have the same value for a name attribute, then you can use filters to further refine location strategy. The default filter type is value (matching the value attribute).<\/li>\n<\/ul>\n<p>&lt;html&gt;<\/p>\n<p>&lt;body&gt;<\/p>\n<p>&lt;form id=&#8221;loginForm&#8221;&gt;<\/p>\n<p>&lt;input name=&#8221;username&#8221; type=&#8221;text&#8221; \/&gt;<\/p>\n<p>&lt;input name=&#8221;password&#8221; type=&#8221;password&#8221; \/&gt;<\/p>\n<p>&lt;input name=&#8221;continue&#8221; type=&#8221;submit&#8221; value=&#8221;Login&#8221; \/&gt;<\/p>\n<p>&lt;input name=&#8221;continue&#8221; type=&#8221;button&#8221; value=&#8221;Clear&#8221; \/&gt;<\/p>\n<p>&lt;\/form&gt;<\/p>\n<p>&lt;\/body&gt;<\/p>\n<p>&lt;html&gt;<\/p>\n<ul>\n<li>name=username (4)<\/li>\n<li>name=continue value=Clear (7)<\/li>\n<li>name=continue Clear (7)<\/li>\n<li>name=continue type=button (7)<\/li>\n<\/ul>\n<p>\u00a0<\/p>\n<div class=\"apply\">\n<div class=\"apply\">\n<p><a href=\"https:\/\/www.vskills.in\/practice\/selenium\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-93268 size-full aligncenter\" src=\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2020\/12\/Free-Practice-test.png\" alt=\"Selenium professional free practice test\" width=\"960\" height=\"150\" srcset=\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2020\/12\/Free-Practice-test.png 960w, https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2020\/12\/Free-Practice-test-300x47.png 300w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><\/p>\n<\/div>\n<\/div>\n\n\n<p><a href=\"https:\/\/www.vskills.in\/certification\/tutorial\/selenium-certification\/\" target=\"_blank\" rel=\"noreferrer noopener\">Go back to Tutorial<\/a>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"https:\/\/www.vskills.in\/certification\/testing\/certified-selenium-professional\" target=\"_blank\" rel=\"noreferrer noopener\">Go to Home Page<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Selenium IDE | Locating the Elements For many Selenium IDE commands, a target is required. This target identifies an element in the content of the web application and consists of the location strategy followed by the location in the format locatorType=location. The locator type can be omitted in many cases. One of the most fundamental&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"","meta":{"footnotes":""},"categories":[350],"tags":[7069,7074,383,6822,7068,7026,7071,349,7027,7067,6821,7073,7066,7025,7072,7070],"class_list":["post-803","page","type-page","status-publish","hentry","category-selenium","tag-java-selenium","tag-learn-selenium","tag-locating-elements","tag-selenium","tag-selenium-2","tag-selenium-automation-testing","tag-selenium-basics","tag-selenium-certification","tag-selenium-documentation","tag-selenium-java","tag-selenium-professional","tag-selenium-test","tag-selenium-testing","tag-selenium-webdriver","tag-what-is-selenium-testing","tag-what-is-selenium-webdriver"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Selenium Tutorials Selenium IDE | Locating Elements<\/title>\n<meta name=\"description\" content=\"Learn and enhance your selenium IDE skills. Become a Certified Selenium Professional Now! Start your preparation with free practice test!\" \/>\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.vskills.in\/certification\/tutorial\/selenium-ide-locating-elements\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Selenium Tutorials Selenium IDE | Locating Elements\" \/>\n<meta property=\"og:description\" content=\"Learn and enhance your selenium IDE skills. Become a Certified Selenium Professional Now! Start your preparation with free practice test!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.vskills.in\/certification\/tutorial\/selenium-ide-locating-elements\/\" \/>\n<meta property=\"og:site_name\" content=\"Tutorial\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/vskills.in\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-12T08:43:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2020\/12\/Certified-Selenium-Professional-15.png\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/selenium-ide-locating-elements\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/selenium-ide-locating-elements\/\",\"name\":\"Selenium Tutorials Selenium IDE | Locating Elements\",\"isPartOf\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/selenium-ide-locating-elements\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/selenium-ide-locating-elements\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2020\/12\/Certified-Selenium-Professional-15.png\",\"datePublished\":\"2013-01-02T07:53:46+00:00\",\"dateModified\":\"2024-04-12T08:43:13+00:00\",\"description\":\"Learn and enhance your selenium IDE skills. Become a Certified Selenium Professional Now! Start your preparation with free practice test!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/selenium-ide-locating-elements\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.vskills.in\/certification\/tutorial\/selenium-ide-locating-elements\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/selenium-ide-locating-elements\/#primaryimage\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2020\/12\/Certified-Selenium-Professional-15.png\",\"contentUrl\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2020\/12\/Certified-Selenium-Professional-15.png\",\"width\":750,\"height\":400},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/selenium-ide-locating-elements\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Selenium IDE | Locating the Elements\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"name\":\"Tutorial\",\"description\":\"Vskills - A initiative in elearning and certification\",\"publisher\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\",\"name\":\"Vskills\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"contentUrl\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"width\":73,\"height\":55,\"caption\":\"Vskills\"},\"image\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/vskills.in\/\",\"https:\/\/x.com\/vskills_in\",\"https:\/\/www.linkedin.com\/company-beta\/1371554\/\",\"https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Selenium Tutorials Selenium IDE | Locating Elements","description":"Learn and enhance your selenium IDE skills. Become a Certified Selenium Professional Now! Start your preparation with free practice test!","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.vskills.in\/certification\/tutorial\/selenium-ide-locating-elements\/","og_locale":"en_US","og_type":"article","og_title":"Selenium Tutorials Selenium IDE | Locating Elements","og_description":"Learn and enhance your selenium IDE skills. Become a Certified Selenium Professional Now! Start your preparation with free practice test!","og_url":"https:\/\/www.vskills.in\/certification\/tutorial\/selenium-ide-locating-elements\/","og_site_name":"Tutorial","article_publisher":"https:\/\/www.facebook.com\/vskills.in\/","article_modified_time":"2024-04-12T08:43:13+00:00","og_image":[{"url":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2020\/12\/Certified-Selenium-Professional-15.png","type":"","width":"","height":""}],"twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/selenium-ide-locating-elements\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/selenium-ide-locating-elements\/","name":"Selenium Tutorials Selenium IDE | Locating Elements","isPartOf":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/selenium-ide-locating-elements\/#primaryimage"},"image":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/selenium-ide-locating-elements\/#primaryimage"},"thumbnailUrl":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2020\/12\/Certified-Selenium-Professional-15.png","datePublished":"2013-01-02T07:53:46+00:00","dateModified":"2024-04-12T08:43:13+00:00","description":"Learn and enhance your selenium IDE skills. Become a Certified Selenium Professional Now! Start your preparation with free practice test!","breadcrumb":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/selenium-ide-locating-elements\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.vskills.in\/certification\/tutorial\/selenium-ide-locating-elements\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/selenium-ide-locating-elements\/#primaryimage","url":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2020\/12\/Certified-Selenium-Professional-15.png","contentUrl":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2020\/12\/Certified-Selenium-Professional-15.png","width":750,"height":400},{"@type":"BreadcrumbList","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/selenium-ide-locating-elements\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vskills.in\/certification\/tutorial\/"},{"@type":"ListItem","position":2,"name":"Selenium IDE | Locating the Elements"}]},{"@type":"WebSite","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","name":"Tutorial","description":"Vskills - A initiative in elearning and certification","publisher":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization","name":"Vskills","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","contentUrl":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","width":73,"height":55,"caption":"Vskills"},"image":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/vskills.in\/","https:\/\/x.com\/vskills_in","https:\/\/www.linkedin.com\/company-beta\/1371554\/","https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw"]}]}},"_links":{"self":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/803","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/comments?post=803"}],"version-history":[{"count":18,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/803\/revisions"}],"predecessor-version":[{"id":93466,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/803\/revisions\/93466"}],"wp:attachment":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/media?parent=803"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/categories?post=803"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/tags?post=803"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}