How to create selectionObject for selenium kantu


#1

Hi,

I’m testing a javaScript based application with selenium kantu. My application passes the selectionObjects (created by user with mouse from html tables) to javascripts.

Can somebody help me in providing the selection objects for selenium kantu macros ? When I record they don’t become recorded, thus they should be added manually into the scripts… I just don’t know how to do it.

I’ve asked the same question here, too


#2

Hi, do you have a link to the website? This way we can test it directly.

If that is not possible, maybe a screenshot of the website can help to us to understand the situation. Is this about drag & drop automation?


#3

It’s a normal HTML table from which user selects with mouse one or more cells. If the user then clicks for instance button called “column header”, the HTML page will pass the selection (window.getSelection()) to javaScript which adds the HTML formatting to the selected cells.
My problem is that I don’t know how to create that selection in selenium kantu. Some code below:

function setAsCaption(selection){
var elems = document.body.getElementsByTagName("*");
var n;
for ( var x=0; x < elems.length; x++){
if ( elems[x].innerHTML.replace(/[\n\r\t" “]/g,”") == selection.toString().replace(/[\n\r\t" “]/g,”")){
n = document.getElementsByTagName(“table”)[0].createCaption();
n.innerHTML = selection.toString();
elems[x].parentNode.removeChild(elems[x]);
break; }}}

'<'input type=“button” value=“caption” onclick=“setAsCaption(window.getSelection())” ‘>’


#4

Sorry, I fail to understand… maybe a short screencast of the task you want to automate would help.


#5

So I’ve implemented a tool for which the user can paste his/her excel tables (text area on top of the buttons in the screen), create a html table and make modifications like row headers, column headers, caption, etc. for the selected rows.

My problem is that I don’t know how to simulate this cell selection in selenium kantu. I currently think it would be possible only with selenium webdriver, right?


#6

Actually, it is the other way around: With regards to automating user actions inside web pages, Kantu can do everything that webDriver can do. So if you would have found a way doing of it with webDriver, I could tell you how to “translate” that into a macro that works with Kantu. The reason for this is that both, webDriver and the Kantu Selenium IDE commands, operate on the DOM.

Soon you will be able to this with the new XCLICK and XTYPE commands. These commands simulate real mouse clicks and you can then use e. g. XTYPE | ${KEY_CTRL}+ ${KEY_A} to highlight all values in a field.


#7

Thanks !
So these XCLICK and XTYPE commands are not yet available? When can I expect them ?
Jaana