1

I want to automate the Handontable using Selenium WebDriver using Java. Basically, I want to enter data in the handontable using selenium(Java).

Is there any way available to enter data in the table. Handsontable is written in JavaScript and works with the most popular frameworks such as Angular, Vue and React And my code is in Java.

==Edit==

For clarification, I have attached the table screen-shot as well.

enter image description here

==DOM==

Dom Structure --

<tr><th class="" style="height: 39px;">
<div class="relative"><span class="rowHeader">1</span>
    </div></th><td class=""></td>
<td class="htCenter htMiddle afterHiddenColumn firstVisibleColumn htAutocomplete">
<div class="htAutocompleteArrow">▼</div></td><td class=""></td>
<td class="htCenter htMiddle afterHiddenColumn htAutocomplete">
<div class="htAutocompleteArrow">▼</div>
    </td><td class="htCenter htMiddle htAutocomplete">
<div class="htAutocompleteArrow">▼</div></td><td class=""></td>
<td class="htCenter htMiddle afterHiddenColumn htPlaceholder">####A/P-####A/P</td>
<td class="htCenter htMiddle"><label class="htCheckboxRendererLabel">

And when scroll works it will change --

<tr><th class="" style="height: 39px;">
<div class="relative"><span class="rowHeader">1</span>
    </div></th>
<td class="htCenter htMiddle">0.000</td>
<td class="htCenter htMiddle editorFalse fs-ignore-rage-clicks">0.00</td>
<td class="htCenter htMiddle">0.00</td>
<td class="htCenter htMiddle">0.0</td>
<td class="htCenter htMiddle">0.00</td>
<td class="htCenter htMiddle editorFalse fs-ignore-rage-clicks">0.00</td>
<td class="htCenter htMiddle">0.000</td>
<td class="htCenter htMiddle editorFalse fs-ignore-rage-clicks">0.00</td>
<td class=""></td><td class="htCenter htMiddle afterHiddenColumn">0</td>
<td class="htCenter htMiddle">0</td><td class="htCenter htMiddle">0</td>
<td class="htCenter htMiddle">0</td><td class="htCenter htMiddle">0</td>
<td class="htCenter htMiddle">0</td><td class="htCenter htMiddle"></td>
<td class=""></td><td class=""></td>
<td class="htCenter htMiddle afterHiddenColumn">
7
  • 1
    Hi what have you tried so far ?
    – PDHide
    Dec 16, 2019 at 11:34
  • @PDHide 1. I have tried to create unique XPath. But, after the scroll bar, the table format is getting changed. This means unique XPath is no longer pointing to the right point. It is getting deviate and point to some other element. 2. Also I have tried the JavaSctiptExecutor as well but no luck Dec 16, 2019 at 11:53
  • 1
    Please show the dom to understand more
    – PDHide
    Dec 16, 2019 at 12:01
  • 1
    Also the code you have tried so far
    – PDHide
    Dec 16, 2019 at 12:08
  • 2
    I think the best way is to ask developer to add id tags to each column element. You can identify row element using the tag div containing text 1 or 2 or so on ( according to the row you need). But to identify the column element, instead of coming up with complex logic its better to request them for an unique id for each column.
    – PDHide
    Dec 16, 2019 at 13:34

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.