Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

How to Send Text in javascript's basic auth #14662

Closed
jt4000 opened this issue Nov 24, 2016 · 1 comment
Closed

How to Send Text in javascript's basic auth #14662

jt4000 opened this issue Nov 24, 2016 · 1 comment
Labels

Comments

@jt4000
Copy link

jt4000 commented Nov 24, 2016

Goal:
Add text "Accepting the alert" in the textbox from javascript's basic auth dialog and then click button "OK".

Problem:
When I execute the code "driver.SwitchTo().Alert().SendKeys("Accepting the alert");" I retrieve a error message that is "Missing 'value' parameter (IndexOutOfBounds)".

Can't find a relevant answer to my problem. Tried to solve this case but it didn't go so well.

Info:
*Using Visual Studio and Selenium for C# code.

Thank you!


FirefoxDriverService firefoxDriverService = FirefoxDriverService.CreateDefaultService(@"C:\\Test3", "geckodriver.exe");
    firefoxDriverService.FirefoxBinaryPath = @"C:\Program Files (x86)\Mozilla Firefox\firefox.exe";


    var driver = new FirefoxDriver(firefoxDriverService);
    driver.Navigate().GoToUrl("http://toolsqa.wpengine.com/handling-alerts-using-selenium-webdriver/");
    driver.Manage().Window.Maximize();
    IWebElement element = driver.FindElement(By.XPath("//button[contains(@onclick,'promptConfirm')]"));

    try
    {
        IJavaScriptExecutor executor = (IJavaScriptExecutor)driver;

        executor.ExecuteScript("arguments[0].click();", element);
    }
    catch (InvalidOperationException eee)
    {
        int dd = 23;

    }


    driver.SwitchTo().Alert().SendKeys("Accepting the alert");

data

@stale stale bot added the stale label Dec 26, 2019
@stale
Copy link

stale bot commented Dec 29, 2019

Due to our very limited maintenance capacity, we need to prioritize our development focus on other tasks. Therefore, this issue will be automatically closed (see #15395 for more details). In the future, if we see the need to attend to this issue again, then it will be reopened. Thank you for your contribution!

@stale stale bot closed this as completed Dec 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant