Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.type() not working #144

Open
bijanx opened this issue Oct 9, 2014 · 9 comments
Open

.type() not working #144

bijanx opened this issue Oct 9, 2014 · 9 comments
Assignees
Labels

Comments

@bijanx
Copy link

bijanx commented Oct 9, 2014

Hello,

I can't get .type() to enter anything into our email input form on our site. It does work fine on amazon for me, everything else remaining the same.

here's the html:

<input autofocus="autofocus" class="login-textfield" id="user_email" name="user[email]" size="30" type="email" value="">

I call .type('#user_email', "[email protected]") then take a screenshot. It's blank.

I tried using setValue but that was resulting in an error. I tried to use the workaround for the Github issue around this setValue bug (backspace chars) but this didn't fix it.

I tried:

  • getting rid of value in html
  • setValue (errored: "{ '0': undefined }")
  • various selectors to grab that input, e.g. "input[name=user[email]]", "input#user_email"
  • asserting the input is visible and exists (both return true)
@ghguy
Copy link

ghguy commented Nov 6, 2014

Not sure if it will help, but have have you tried to add new line? e.g.

.type('#user_email', "[email protected]\n")

@askilada
Copy link

I have a problem as well. I'm trying to use type within a iframe so I'm trying to do:

.toFrame("#iframe-frame")
.type(".datagrid-search input", 'Hello')

but nothing happend

@ghguy
Copy link

ghguy commented Nov 18, 2014

Have you tried just:

.type("#iframe-frame", 'Hello') ?

PS. Assuming #iframe-frame is unique across the page.

@askilada
Copy link

Yes and my #iframe-frame is also an actual iFrame, and is being updated as i go. I have the same problems with using click inside an iFrame

the way i need to inject those things is via jQuery like

            .execute(function() {
                $('.dialog-footer .btn-close').click()
            })

@asciidisco
Copy link
Member

@bpourriahi @askilada
Could you please report a few bits on your environment (Which browser you´re testing on, OS, Browser & OS version), that I can try to reproduce the issue.

Also, could you start Dalek with the parameter -l 5 like so dalek mytest.js -l 5,
and add a .log.dom('#your_inout_selector', ) method before trying to type something, see http://dalekjs.com/docs/actions.html#meth-log.dom?!

When you have the output, please paste it into the issue (formatted as code) & we can start to debug.

Btw.: @ghguy thanks for helping out with your suggestions :)

@asciidisco asciidisco self-assigned this Dec 3, 2014
@asciidisco asciidisco added the bug label Dec 3, 2014
@rafinskipg
Copy link

Using phantomJS and trying to type in a input text after redirecting from other website, it does not add anything to the input.

@rafinskipg
Copy link

.waitForElement('#id_username')
    .log.dom('#id_username')
    .setValue('#id_username', 'MY USER')
    .assert.val('#id_username', 'MY USER', 'Username has been set')

Output

✔ URL We are at Login
▶ WAITFORELEMENT 
☁ [USER] DOM: #id_username  Not found
▶ SETVALUE #id_username
✘ VAL
0 EXPECTED: MY USER
0 FOUND: 
0 MESSAGE: Username has been set

@rafinskipg
Copy link

I tried with setValue and type.

  • nodejs version 0.10.38
  • dalekjs version 0.0.9
  • Browser phantomjs
    -output console
    launching with gulp-dalek

@rafinskipg
Copy link

When i do

.log.dom('body')

It works, but other selectors are not working, even when i'm seeing that html on the body log

.log.dom('#id_username') //Not found

@whiteflame72
Copy link

I believe for iframe or frame (within frameset), the "frame" is not selectable via CSS selector. Could you try:

document.getElementById("iframe-frame").contentDocument.querySelector('#id_username')

and see if it can be found?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants