dalekjs / dalek-internal-actions

[unmaintained] DalekJS internal module for browser actions
6 stars 0 forks source link

setValue exits with { '0': undefined } #11

Closed xrado closed 10 years ago

xrado commented 11 years ago

.type('#email','info@example.com') works just fine, but if I replace it with .setValue('#email', 'info@example.com') outputs { '0': undefined } and exits the execution

tested with phantomjs and chrome

asciidisco commented 11 years ago

Thanks for your report. I´ve checked it & yes, you are right, this method calls something internally that does not work correctly, will be fixed in the next release.

teneightfive commented 10 years ago

Hi, is there any news on this being fixed @asciidisco ? I'm trying to find a way to select a value in a select box but using setValue is throwing the error mentioned above.

Is there an alternative method to selecting a dropdown value?

asciidisco commented 10 years ago

Ah sorry, I totally forgot about this one. I´m really sorry :/ I´m giving a high priority on my list & get back to you asap.

ghost commented 10 years ago

Since this is still open, I assume that it hasn't been addressed yet. However, I think I have found a workaround for it. This is more directed to @teneightfive ...

Lets say you have:

<select id="myselect">
  <option value="one">One</option>
  <option value="two">Two</option>
  <option value="three">Three</option>
</select>

And you want to select the second option, "two". Do:

.click('#myselect')
.click('#myselect option[value="two"]')

That is what worked for me!

Edit: This currently won't work with FireFox.

pratima21 commented 10 years ago

i need to set value empty for an input field …is there any way around for that other than setValue in dalekjs

edwardchc commented 10 years ago

facing the same problem and also need to set value to blank for an input field. getting { '0': undefined }.

izocan commented 10 years ago

same issue here. please help

mischah commented 10 years ago

Ran into this one yesterday while checking out DalekJS. My workaround was using the execute() method which executes a JavaScript function within the browser context.

So if you are using jQuery on the page you’re running the tests it is as simple as:

.execute(function () {
    $('#selector').val('');
})
asciidisco commented 10 years ago

Fixed in canary