SeleniumLibrary icon indicating copy to clipboard operation
SeleniumLibrary copied to clipboard

Add ability to type into a prompt

Open boakley opened this issue 12 years ago • 14 comments

Right now it is not possible to type into a javascript prompt -- the only options are to confirm or cancel an alert.

I would like support for a keyword like "Insert into prompt" that would type into a prompt.

I did a quick prototype on my mac, and it seemed pretty easy to implement:

    def insert_into_prompt(self, text):
        alert = None
        try:
            alert = self._current_browser().switch_to_alert()
            alert.send_keys(text)

        except WebDriverException:
            raise RuntimeError('There were no alerts')

boakley avatar May 12 '14 19:05 boakley

Sounds like a good suggestion.

emanlove avatar May 14 '14 11:05 emanlove

Should probably be named like "Input Text Into Prompt" to be consistent with "Input Text".

pekkaklarck avatar May 14 '14 11:05 pekkaklarck

Hey guys.. Will it helps me for my probleM?

My problem is the following: I have an upload form, and when I do upload file and click a button - my web-application automatically send me a new file for downloading. I can't handle this firefox downloading window :(

Im fighting with this for like a several days ...

Kristina001 avatar May 16 '14 14:05 Kristina001

@Kristina001 I do not think this will help for your situation unfortunately. This is for the JS method Window prompt.

ombre42 avatar May 16 '14 16:05 ombre42

When I do something like Go to https://username:[email protected] Input Text Into Prompt ${url_username}

(Or you can just open Privet window) I get this. Does it look like an alert? If so then "Input Text Into Prompt" keyword doesn't work for Safari Technology Preview Release 33 (Safari 11.0, WebKit 12604.1.25.0.2)

screen shot 2017-06-18 at 10 40 08 am

SerhiiAksiutin avatar Jun 18 '17 17:06 SerhiiAksiutin

Please open a new issue or send mail to the Robot Framework user group.

aaltat avatar Jun 19 '17 08:06 aaltat

Is this issue solved?

ShAnsari avatar Jun 21 '17 07:06 ShAnsari

See https://github.com/robotframework/SeleniumLibrary/issues/827

aaltat avatar Jun 21 '17 11:06 aaltat

It's ok for type in first username textfield but how can i input on password field ?

antho03 avatar Nov 15 '17 14:11 antho03

Please ask the question in the Robot Framework user group or open a new issue. First one is preferred.

aaltat avatar Nov 15 '17 14:11 aaltat

Hi above issue got solved?? please let me know i also facing similar kind of problem.

Ballalokesh avatar Dec 06 '18 09:12 Ballalokesh

Hi, How to input text into alert when there are two fields ? Anyone figured out how to input text in the alert second input field(for example: password field) ?

Thanks, Satya

satymaju avatar May 06 '20 21:05 satymaju

When I do something like Go to https://username:[email protected] Input Text Into Prompt ${url_username}

(Or you can just open Privet window) I get this. Does it look like an alert? If so then "Input Text Into Prompt" keyword doesn't work for Safari Technology Preview Release 33 (Safari 11.0, WebKit 12604.1.25.0.2)

screen shot 2017-06-18 at 10 40 08 am

Yes , I am getting the same problem it is not an alert. Have you been able to find how to input text there, without the url technique(https://username:[email protected]`) ?

satymaju avatar May 06 '20 22:05 satymaju

See https://github.com/robotframework/SeleniumLibrary/issues/292#issuecomment-310044552 and for support read https://github.com/robotframework/SeleniumLibrary/blob/master/README.rst#support

aaltat avatar May 07 '20 05:05 aaltat