{"id":1471,"date":"2022-08-30T15:16:48","date_gmt":"2022-08-30T15:16:48","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/19\/it-is-not-possible-to-click-on-a-link-inside-of-a-frame-mac-ruby-safariwatir-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:16:48","modified_gmt":"2022-08-30T15:16:48","slug":"it-is-not-possible-to-click-on-a-link-inside-of-a-frame-mac-ruby-safariwatir-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/it-is-not-possible-to-click-on-a-link-inside-of-a-frame-mac-ruby-safariwatir-collection-of-common-programming-errors\/","title":{"rendered":"It is not possible to click on a link inside of a frame (Mac-Ruby-safariwatir)-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;m writing a test in Mac via Ruby 1.9.2-p136 using safariwatir 0.4.0<\/p>\n<p>So, I have a link on the page<\/p>\n<pre><code>Add Content\n<\/code><\/pre>\n<p>which is located inside of the frame &#8220;main&#8221; and this frame is located inside of the other frame &#8220;content&#8221;<\/p>\n<p>I need to click this link and go to another page, but I can&#8217;t because when I use<\/p>\n<p><strong>@browser.frame(:name,&#8217;content&#8217;).frame(:name,&#8217;main&#8217;).link(:text, &#8216;Add Content&#8217;).click<\/strong><\/p>\n<p>then the link is highlighted, but after that when &#8216;click method&#8217; is called in safariwatir api I get the following error:<\/p>\n<p><strong>undefined method `is_frame?&#8217; for nil:NilClass<\/strong><\/p>\n<p>If I use xpath like this:<\/p>\n<p><strong>@browser.frame(:name,&#8217;content&#8217;).frame(:name,&#8217;main&#8217;).link(:xpath, &#8216;\/\/a[text()=&#8221;Add Content&#8221;]&#8217;).click<\/strong><\/p>\n<p>then the link is highlighted too, but nothing happens (there is no error, but an another page is not appeared)<\/p>\n<p>this commands return<\/p>\n<p><em>puts @browser.frame(:name,&#8217;content&#8217;).frame(:name,&#8217;main&#8217;).link(:xpath, &#8216;\/\/a[text()=&#8221;Add Content&#8221;]&#8217;).exist? =&gt; true<\/em><\/p>\n<p><em>puts @browser.frame(:name,&#8217;content&#8217;).frame(:name,&#8217;main&#8217;).link(:xpath, &#8216;\/\/a[text()=&#8221;Add Content&#8221;]&#8217;).href =&gt; javascript:Dashboard.set(&#8216;select-template-category&#8217;);document.forms[0].action=&#8217;\/qa7\/DashboardAdminAction.do&#8217;;document.forms[0].submit()<\/em><\/p>\n<p><em>puts @browser.frame(:name,&#8217;content&#8217;).frame(:name,&#8217;main&#8217;).link(:xpath, &#8216;\/\/a[text()=&#8221;Add Content&#8221;]&#8217;).title =&gt; Add more items to your dashboard<\/em><\/p>\n<p><em>puts @browser.frame(:name,&#8217;content&#8217;).frame(:name,&#8217;main&#8217;).link(:xpath, &#8216;\/\/a[text()=&#8221;Add Content&#8221;]&#8217;).text =&gt; Add Content<\/em><\/p>\n<p><em>puts @browser.frame(:name,&#8217;content&#8217;).frame(:name,&#8217;main&#8217;).link(:xpath, &#8216;\/\/a[text()=&#8221;Add Content&#8221;]&#8217;).html =&gt; Add Content<\/em><\/p>\n<p>Could you explain me what is wrong or this is a bug of safariwatir ?<\/p>\n<p>Thanks, Alexey<\/p>\n<p id=\"rop\"><small>Originally posted 2013-11-19 13:19:02. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I&#8217;m writing a test in Mac via Ruby 1.9.2-p136 using safariwatir 0.4.0 So, I have a link on the page Add Content which is located inside of the frame &#8220;main&#8221; and this frame is located inside of the other frame &#8220;content&#8221; I need to click this link and go to another page, but I can&#8217;t [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1471","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1471","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1471"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1471\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1471"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1471"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1471"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}