Clicking on an image or label in PageObject - pageobjects

label(:enable_allchild, :id => 'colHeader-Status')
image(:enable_allchild, :src => 'image/selectAll.gif')
label(:enable_allchild, :text => "Enable")
Tried all three of these
enable_allchild_element.click
Selenium::WebDriver::Error::ElementNotVisibleError: cannot click on element

Is it definitely the image or label that receive the click that actually does something? I've had a similar issue before and it turned out that the click was actually received by the span or div (I forget) that the image and label were in.

Related

selecting and highlighting text in javafx with events and identification

I have to interact in javaFx with text and have no fitting "node" for this situation.
I have to select a displayed text by mouse. This selection has to be highlighted with a specific background-color. Each further selections have to have other background colors and some selections have to have the same background-color. By click at the highlighted text, an event has to be activated/fired. It would be wonderful if there is also an contextmenue to interact with at right click on the marked text for removing the action and highlighting abilities. This text should be scrolled to by an other action event and at least to have a logical connection/reference/identification to a java object what is created with the content of the highlighted text. I have some external text filters, so I have to remember the position of the highlighted text.
Do you have any suggestions? Is there a right node for this in JavaFx? Any hidden library?
I am really frustrated because my actual solution with the webview element/webengine is very messy and some features are missing.
Actual solution:
Cycle1: Text => useFilter => constructHtmlReadyText => putIntoWebEngine => displayInWebViewer
Cycle2: OnMouseReleased => getPositionOfTextAndText(by JavaScriptEngine) => addInformationOfPositionAndText => Cyclus1
The main problem on this scenario is to get the position of the selected text on the second selectioncycle.

Button click on Seesaw (Clojure) not getting new variable values

Having a problem with seesaw where i'm trying to let the user select the date using combo boxes and then call the function on a button click:
(listen load-data-btn :action (load-data
(selection year-cmb) (selection month-cmb) (selection day-cmb)))
This works however, the action loads when the program initially runs so whenever the button is clicked it always contains the first value the combo box is selected. So when I click the button it doesn't look for a new value in (selection year-cmb) it just keeps the one it's already got, the default is set to "".
Any idea how I make it so that every time I click the button call it will get the new value inside the combo box?
my problem was that I hadn't encapsulated the value in an (fn [e]) statement like below
(listen load-data-btn :action (fn [e]
(load-data (selection year-cmb) (selection month-cmb) (selection day-cmb))))

SAPUI5 VizFrame: How to get the selected data points

I used a VizFrame to display data in my project.
The normal behaviour of the VizFrame when you select data in the graph you see a popover with the data of the selected point. When you select more than one point the content of the popover is something like in the screenshot: popover content.
I tried using attaching myself to the SelectedData Event. The oControlEvent.mParameters contain the data nodes being currently selected for THAT event.
For example: I click node A => the node A is in the oControlEvent.mParameters. => OK
Then I click additionally on node B (so node A and B are selected) => only the node B is contained in the oControlEvent.mParameters. => not OK.
What I need is the set of all nodes that are currently selected in the graph, not just the one that triggered the event.
This information must be contained somewhere, as the Tooltip correctly shows "2 data nodes selected" after the user clicked B.
Thanks for your help.
the oControlEvent.mParameters.data, or oControlEvent.getParameter('data') will (correctly) only contain the elements that actually triggered the event. (may be more than one data point if you select several data points in one go by dragging a rectangular area over the data points)
if you need all currently selected data points, use oControlEvent.getSource().vizSelection() (here, getSource() will return the vizFrame)
Cheers, iPirat

Select jQuery UI Button by Label or $.Data

My buttons are input type=button, id field set, and no text in between the tags since it appears to the right of my buttons rather than inside. (sorry, won't let me publish the html for some reason).
I .button() them and set their label. All works as expected, but I can't select them by :contains().
How do you select jQuery UI buttons by their labels?
Thanks in advance!
Edit
I don't select by id because the text of the button changes based upon a variable in my db. Is there a way to select by .data?
You should create a button and look how jQuery creates it. When you look at the example in the documentation you see that .button() creates a span element in the button element that contains the label. So you can query on this inner span element which has a class of ui-button-text.
But I think that you should overthink your code and rework it so that you can select on the ID since they are made to identify things.
Edit: Then go for the first advice
var buttons = $('button').filter(function (index) {
$('.ui-button-text:contains("' + your_string + '")', this).length > 0
});

jquery .attr('alt','logo').css('display','none') not working !

I have the three following lines and the first two line gets all the images on the document and hides all, but then when I add the third line shows all the images.
What I need its to hide only the images with the attribute alt=minimize and alt=maximize but for some reason hides all the images.
$('img').attr('alt', 'minimize').css("display","none");
$('img').attr('alt', 'maximize').css("display","none");
$('img').attr('alt', 'logo').css("display","inline");
I am using IE7, but it should be compatible with IE6 and IE8.
Any help would be very much appreciated.
Thanks.
I'm thinking you are not using the attr function correctly, might you be looking for the attribute equals selector?:
$('img[alt=minimize]').css("display","none");
What you did with your code was,
Select all images
Change their alt attribute to 'minimize'
Hide them
Select all images
Change their alt attribute to 'maximize'
Hide them
Select all images
Change their alt attribute to 'logo'
Hide them
what you do: you take every img in document and set alt to logo and then set display: inline;.
Note, that attr('alt',string) doesn't filter all images to those with alt=string, but rather sets alt attribute to string on all images.
What you want to use is this:
$('img[alt="minimize"]').css...
$('img[alt="maximize"]').css...
$('img[alt="logo"]').css...
In the call $('img').attr('alt', 'logo').css("display","inline"); the "attr" doesen't filter the set of dom elements You catch with $("img").
If you want to hide everithing but not the image with the attribute 'alt' = 'logo' I think You can:
give it an Id of logo and then calling: $("img").not("#logo").hide()
from the jquery website:
hide():
The matched elements will be hidden
immediately, with no animation. This
is roughly equivalent to calling
.css('display', 'none'), except that
the value of the display property is
saved in jQuery's data cache so that
display can later be restored to its
initial value. If an element has a
display value of inline, then is
hidden and shown, it will once again
be displayed inline.
and
attr( attributeName )
Returns: String
Description: Get the value of an
attribute for the first element in the
set of matched elements.
If instead you want to hide all the maximize and minimize images (both share the "imize" part of the attribute):
$(parentElement).find("img[#attr $= '*imize']").hide()
OP is referring to
http://dev.w3.org/csswg/css3-values/#attr
alt I think is simply a string type, not "logo" whatever that is, that is not a data type.
try that. in fact, you can look up alt in the html5 img
http://www.w3.org/TR/html5/the-img-element.html#the-img-element
http://www.w3.org/TR/html5/the-img-element.html#attr-img-alt
http://www.w3.org/TR/html5/the-img-element.html#alt
(in order of reference clicking, last one is the target)
even if this isn't the exact answer (it should be), it should be a step in the right direction.
I am actually trying myself to figure out how to reference a css property within css with attr() - it's mentioned within the top URL. if I had my druthers, I could be using css calc() along with it, but that's draft. maybe I can get it to work...