Selenium WebDriver and Highchart testing - java

I know this question has been asked before on S.O. and other websites but I haven't found a definite answer -- most of them say its not easily done but I wanted to make sure that was the final verdict.
Here's my situation:
I'm testing a website that is using Highcharts (http://www.highcharts.com) using Selenium WebDriver (Java).
I basically want to grab the information that is displayed in a small tooltip pop-up that appears when you hover your mouse over each datapoint on the Highchart's line graph.
Looking at the web page's HTML code, I noticed there is <g class="highcharts-tooltip".... I also noticed that, as you move your mouse, the (X,Y) values in ...transform="translate(X,Y)"> change, which then changes the information displayed in the tool tip.
Knowing this, my approach would be to somehow grab all the (X,Y) values and plug them into the transform fields and grab the tooltip data. But I don't know how to programmatically grab all the (X,Y) values through Selenium.
Has anyone tackles this issue in the past or has a better way to grab the necessary information?

I started creating a library to work with HighCharts, what I currently have is available here:
https://github.com/Ardesco/Powder-Monkey/tree/master/src/main/java/com/lazerycode/selenium/graphs
It's quite hard to provide a generic library that deals with HighCharts as the customisation options on the individual charts can modify the SVG markup quite a bit. Hopefully the above will help to a degree.
As I do more it will be updated.

The Line Charts have to have a background to work. If the chart is created with .setBackgroundColour(null), then the "rect" is not added to the html.
I was able to to add the background colour back in set to the body background colour. However I'll try and figure out a way of doing it without the "rect".

Related

Trying to Change Dojogrid Rowcolor based on Content

I have a function that generates a Dgrid and fills it with content which it receives from Javaside.
I tried to do dojo-css to handle this like here:
Style Dojox Grid Row depending on data
After this didn´t work I tried to work with Dojo.connect to change the color of the row when the grid is being built and filled.
After that didn´t work I tried to use dojo.on or dojo.aspect.after but since I am a total Newbie in Dojo I have no clue where you can intersect in the code and do theses things.
with a code like so :
require(["dojo/request/xhr","dojo/dom-form", "dojo/dom", "dojo/_base/array", "dojo/json",'dgrid/Grid','dgrid/Selection',"dijit/registry","dojo/_base/declare","dojo/domReady!"],
function(xhr,domForm,dom, array, json, grid, selection,registry, declare){
..... Here the grid and data is declared java function called
}.then(function(data, array, grid, selection,registry, declare){
.....Here the dgrid is filled
}
Where/when should i use Dojo.Connect , Dojo.on or Dojo.after?
I´ve spent mutiple days trying to figure this out but the program either stops working or ignores my changes.
The link you mention above is for dojox grid, which is different to dgrid. Here is the link to css styling for dgrid.
It won't answer your question though which is about changing a row color based on content. The way I do this is cell by cell, using a custom renderCell function.
Documentation on renderCell can be found here, and an example can be found here.
ps: a bit of caution. The learning curve for dojo 1.x is quite steep. When looking for documentation, make sure you get the latest possible (1.10). If you find a link which is about version 1.6 or less, be careful: many 1.6 and before features have been deprecated in version 1.7.

Getting Image Icon colour from inplace list using TestComplete

Little background. I am using test complete and java scripting language for automating the java based desktop application.
I need to click on the row in the table depending on the image colour. If image colour is red it need to be passed and only green should be clicked.
I tried most of the function is test complete none of these returns me image colour.
Do anyone have an idea how do i do this.
This task does not seem to be a usual standard functionality of a GUI testing tool. So, you need to implement this feature using JScript yourself. In general, algorithm is this: get the list object and iterate through its displayed rows working with them as with native Java objects. Use the native field or method to test the current row's color and if the color is appropriate, perform an action of this color. You can get an identified of this native row object and use this identifier to interact with the row with TestComplete's means.
Cannot be more specific due to lack of specific information on the controls used in your application.
Almost every TestComplete on-screen object has reflected upon it the Picture method. You could look at a pixel within that picture object to determine the appropriate color, and then click on that row.

Display 2D text on screen simply

I have been looking through forum posts, blogs, videos, and various other websites for the past hour trying to figure out how to display text on the screen. From what I have seen this is not very simple to do. (Maybe it is once you know how to actually do it)
I decided (with a bit of regret) to post this question here. I am sorry if this question has already been asked a million times, but I am just not understanding how to get this to work. All of the code I have tried so far has not worked.
I would just like to know how I can display text on the screen. I do not want to use my own font or anything fancy. I would just like to know the simplest way to display text on the screen.
The simplest way would be to use Slick. Here's a link to the page specifically about loading and using fonts within your LWJGL program:
Slick-Util (Part 3) - TrueType Fonts for LWJGL
I am learning java currently and I love the newbostin, he makes simple fast tutorials but to display text I'm pretty sure u need to
1: have eclipse
2: make the base of it (the main string, idk how actually)
3. The actual code to do it is println("text here")
I'm not completely sure so you should check out the newBoston he is awesome at explaining.

GWT data display

As a means to display information on a website developed mainly with GWT and EXT-GWT, i am using a HTMLLayoutContainer. So far, the information it is displayed correctly, but it is too harsh or rough to display this way, meaning rough, not nice to see.
So the question is : Is there any other and nicer way to display (print, draw) information with GWT?.
If so, how?
You need to work on CSS
GWT CSS Ref

How do I make a RichTextArea in Google Web Toolkit(GWT) Selectable/Highlight-able by a mouse but not Editable/Modifiable?

I'm currently making a GWT project where I display some HTML in a RichTextArea, and I want the RichTextArea to be selectable/highlight-able by a mouse but NOT be editable/modifiable by the user. In addition to this question, could you also tell me how to retrieve some highlighted text in string from without me having to add a text-background toolbar, which, after highlighting a text from the RichTextArea, you change the color of the text-background, upon which, you add a separate periodically looping thread which checks to see when the text-background changes substantially from white (or a native color of the webpage) and finally extracting the string whose text-background color differs as the selected text.
I really hate to give any pointers without explanation but i think your requirements are bigger ::: so --->
http://examples.roughian.com/index.htm#Widgets~RichTextArea
http://www.java2s.com/Code/Java/GWT/RichTextArea.htm

Categories