Karasiq / scalajs-bootstrap

Scala.js bootstrap components
MIT License
61 stars 19 forks source link

At least some widgets/elements do not work with Selenium IDE #7

Closed jk-1 closed 7 years ago

jk-1 commented 7 years ago

I was trying to run scalajs-bootstrap demo https://karasiq.github.io/scalajs-bootstrap/ using Selenium IDE firefox add-on (http://www.seleniumhq.org/projects/ide/)

I started Selenium IDE recording and tried various things with the demo. Then I stopped recording and tried to rerun the recorded macro step by step.

Buttons and links seem to work same way when comparing original recording run and macro step by step rerun. Text inputs, radio buttons, list selections (plain selection, multiple selection in demo) do not work as they shoud when running macro step by step.

From another app using scalajs-bootstrap I also noticed that password fields and email fields also do not work when running the macro. In this app during the record phase oninput event is fired but during macro rerun oninput event is not fired for some reason although the text changed on the input field also when running macro. onchange event is fired in both cases (recording / macro run).

Is this problem in scalajs-bootstrap or in Selenium IDE?

Here are couple of macros I recorded with Selenium IDE:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="https://karasiq.github.io/" />
<title>New Test</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">New Test</td></tr>
</thead><tbody>
<tr>
    <td>open</td>
    <td>/scalajs-bootstrap/</td>
    <td></td>
</tr>
<tr>
    <td>click</td>
    <td>css=span.glyphicon.glyphicon-plus</td>
    <td></td>
</tr>
<tr>
    <td>type</td>
    <td>id=bs-auto-a397c7bb-ce0c-490f-b0d2-d48da41478d5</td>
    <td>a</td>
</tr>
<tr>
    <td>click</td>
    <td>css=button.btn.btn-primary</td>
    <td></td>
</tr>
<tr>
    <td>click</td>
    <td>css=span.glyphicon.glyphicon-plus</td>
    <td></td>
</tr>
<tr>
    <td>type</td>
    <td>id=bs-auto-c6982873-408e-4bcc-84ff-795f3828d839</td>
    <td>b</td>
</tr>
<tr>
    <td>select</td>
    <td>id=bs-auto-56f4009c-06ad-4080-aa68-8920c75098b9-form-select-input</td>
    <td>label=High</td>
</tr>
<tr>
    <td>click</td>
    <td>css=div.modal-footer &gt; button.btn.btn-primary</td>
    <td></td>
</tr>
<tr>
    <td>click</td>
    <td>css=span.glyphicon.glyphicon-plus</td>
    <td></td>
</tr>
<tr>
    <td>type</td>
    <td>id=bs-auto-00e8704f-cb43-407a-9276-e88c1842ee36</td>
    <td>c</td>
</tr>
<tr>
    <td>select</td>
    <td>id=bs-auto-4be00929-55f3-459a-840f-5d1e8f3a3abb-form-select-input</td>
    <td>label=Low</td>
</tr>
<tr>
    <td>click</td>
    <td>css=div.modal-footer &gt; button.btn.btn-primary</td>
    <td></td>
</tr>

</tbody></table>
</body>
</html>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="https://karasiq.github.io/" />
<title>New Test</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">New Test</td></tr>
</thead><tbody>
<tr>
    <td>open</td>
    <td>/scalajs-bootstrap/</td>
    <td></td>
</tr>
<tr>
    <td>click</td>
    <td>link=Buttons</td>
    <td></td>
</tr>
<tr>
    <td>click</td>
    <td>css=button.btn.btn-success</td>
    <td></td>
</tr>
<tr>
    <td>type</td>
    <td>id=bs-auto-956922b1-7c2a-4e7f-aa83-b7d6ca44b056</td>
    <td>100</td>
</tr>
<tr>
    <td>click</td>
    <td>id=bs-auto-56e850a5-ae11-49a7-9d8a-0775043625f6</td>
    <td></td>
</tr>
<tr>
    <td>select</td>
    <td>id=bs-auto-db5565a4-a280-40bd-a42e-ba244f5e17e5-form-select-input</td>
    <td>label=Option 3</td>
</tr>
<tr>
    <td>addSelection</td>
    <td>id=bs-auto-5aec1164-7576-4127-b244-8f033d310d36-form-select-input</td>
    <td>label=Option 3</td>
</tr>
<tr>
    <td>type</td>
    <td>id=bs-auto-e06a1eba-b111-49d4-afa7-3f3950ff2fb0-form-textarea-input</td>
    <td>aaa</td>
</tr>
<tr>
    <td>click</td>
    <td>css=button.btn.btn-primary</td>
    <td></td>
</tr>

</tbody></table>
</body>
</html>
jk-1 commented 7 years ago

This might be a problem with the Selenium IDE, because it cannot playback correctly simple w3schools demo. I filed this: https://github.com/SeleniumHQ/selenium/issues/4032

Karasiq commented 7 years ago

id=bs-auto-a397c7bb-ce0c-490f-b0d2-d48da41478d5

Looks like Selenium uses auto-generated id, which are always unique.