Oh masters of screen scraping. I'm using jruby and Celerity (both newest versions), and I CANNOT figure out how to click this button. Here is the HTML code:
<div class="chart-toolbar noprint" style="float: left;">
<ul>
<li>
</li>
<li>
<span class="btn-export icon-24 download-24" title="Export"></span>
I've tried everything, I cannot get it to click. Here is my current code:
browser.button(:class, "btn-export icon-24 download-24").click
Here is the error:
Celerity::Exception::UnknownObjectException: Unable to locate Button, using :class and "btn-export icon-24 download-24"
assert_exists at /opt/jruby/lib/ruby/gems/1.8/gems/celerity-0.9.1/lib/celerity/element.rb:179
assert_exists_and_enabled at /opt/jruby/lib/ruby/gems/1.8/gems/celerity-0.9.1/lib/celerity/clickable_element.rb:69
click at /opt/jruby/lib/ruby/gems/1.8/gems/celerity-0.9.1/lib/celerity/clickable_element.rb:9
(root) at ./test.rb:17
Any ideas?
instead of
browser.button(:class, "btn-export icon-24 download-24").click
try
browser.span(:class, "btn-export icon-24 download-24").click
hope this helps!!
Related
I have
<button> More </button>
and I have <div id="x"> </div>
But when I click on link, my page before going to desired div reloads(
I can't reproduce this behaviour on jsfiddle because there it works fine.
Can this be because I am using rails an turned turbolinks off?
If you need I can deploy the code to the server but I haven't done this yet.
Try to set data-turbolinks as false for that href tag.
data-turbolinks="false"
Trying this might solve the issue.
I've created a basic html page with a top navbar which has one of the code snippets as follows
<a href="./team.html" class="hover-effect scroll">
<span>
<span><b>THE TEAM</b></span>
<span><b>THE TEAM</b></span>
<span></span>
</span>
</a>
Now for reasons unknown to me, when I click on the link normally nothing happens. When I click on the scroll wheel to open a new tab, nothing happens. However, when I right click and click on open a new tab then it works.
Also the following works perfectly if on index page:
<a href="./index.html#about" class="hover-effect scroll">
<span>
<span><b>ABOUT</b></span>
<span><b>ABOUT</b></span>
<span></span>
</span>
</a>
But only when I'm on the index page. Not on any other page.
Any ideas why this is happening?
I am working with Semantic UI in a rails project and wanted to create a dropdown menu with items that would link to other view pages. Most of the problems i've seen with the dropdown stemmed from users not initializing the dropdown menu which I was able to do.
Here's my code:
<div class="ui floating dropdown button">
Course<i class="dropdown icon"></i>
<div class="menu">
<% #topics.each { |topic| %>
<a class="item" href="articles/<%= topic.id %>">
<span class="text"> <%= topic.name %></span>
</a>
<% } %>
</div>
</div>
Different things i've tried:
Creating a separate hardcoded links / a tags like <a href="articles/4"> outside of the dropdown menu. This creates a working link and directs me to the article show view page with the id of 4.
Changed the wrapping 's class as "ui floating dropdown item" as well
I've also looked up other users' posts that shows they have the same exact problem. But when i try their solution, my dropdown menu items still do not work and i'm not sure what i'm doing wrong. Here are their posts:
https://github.com/Semantic-Org/Semantic-UI/issues/3234
https://github.com/Semantic-Org/Semantic-UI/issues/453
The two most important things seem to be:
Not putting the dropdown class definition as part of an anchor tag (inserting an anchor tag inside an anchor tag in the dropdown menu)
Not surrounding each anchor tags with their own <div class="items"> tags but to integrate them into one line like <a class="item" href="#"> # </a>
Can anyone help me understand what i might be overlooking? Let me know if i left out any critical information, would love to update the post with the relevant data right away, thank you!
After doing more and more research, I came to the conclusion that the links were not working in my semantic-ui dropdown menu because of some code, most likely Javascript, that i had inserted before.
Of course, i ruled this way out of the realm of possibility because there was no way i would forget about such code but i decided to go through all of my .js files just in case.
Lo and behold, i had a jQuery selector return false when a .item was being clicked...
I felt really silly and i didnt want to believe it at first but if you're having this problem and you've checked everything else like i have, it's probably your javascript!
I'm trying to use an update panel so my page doesn't refresh every time I make a click in a menu item but it seems that what i'm doing is not working out would u help me out?
by the way this code is part of a sub-menu list, so i'm not able to change it for a button or something like that.
this is my code:
<ul id="ebul_mb73g0_2" class="ebul_mb73g0" style="display: none;">
<li>
**<asp:UpdatePanel runat="server" id="UpdatePanel2" updatemode="Conditional">
<ContentTemplate>
<a title="" id="btnStock" tabindex="2" onclick="btnStock_Click">Stock</a>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnStock" eventname="Click" />
</Triggers>
</asp:UpdatePanel>**
</li>
<li><a title="" id="btnSales" tabindex="3">Sales</a></li>
</ul>
and here is the execution error i get:
A control with ID 'btnStock' could not be found for the trigger in UpdatePanel 'UpdatePanel2'
i believe it's because <a></a> is not a control, but is there any way i could make that work out?
thank you for the help =)
You're right, the <a> is not a server side control.
I think you want to change to an <asp:Button> for this since it's not really a link if you want to cause a postback and hit btnStock_Click().
This also could have been solved by adding runat="server" to the tag, presuming there was a need to process the button click server side.
Hi guys I have bought this template, and I am trying to get a link into a sidebar (under links to tabs)
<ul class="nav2 nav">
<li class="selected">Seniors - Studies </li>
<br><div align="center"><img src="images/seniorbrochure.jpg" width="200" class="foo"><br>Download PDF<br><br><div class="heading">We Support</div></div></ul>
This is a bit of the code, as you see I have a link download PDF to pdf.pdf (just as testing) but whenever I click on it it actually loads a blank tab and doesn't try to go to pdf.pdf at all, I can't put the link outside of the ul tab or else the whole layout gets messed up, is there any way around this?
Is the filepath correct? "your website/folder/pdf.pdf" . Or maybe you could try putting a button in the sidebar to download it - <input type="button" value="Download PDF" onClick="window.location.href='/folder/pdf.pdf'">.