way to delay startup web browser

i’would like to ask you is there any way to delay startup web browser using web driver. For example:

IWebDriver driver = new FirefoxDriver(); // how delay startup firefox browser of 10 sec?

Default Asked on January 20, 2016 in Selenium WebDriver.

You just put a Thread.sleep(num of miullisec);
IWebDriver driver = new FirefoxDriver();
after this line.

on January 21, 2016.

it didn’t work as i want to because i want to do something like this:

IWebDriver  driver = new FirefoxDriver(); /delay startup mozilla for some sec. During this time i want to set startup position of window(code below)

driver.Manage().Window.Position = new Point(-2000,0);

Your solution opens firefox browser and wait some sec, then do the rest of the code.
I want to delay startup web browser. or mayby someone know how to add some preference to for ex. firefox profile to set different position window of web browser when it starts.
I need smth like this because i need to change firefox browser position while web browser start. When i’m doing smth like this:

IWebDriver driver = new FirefoxDriver(ffprof);

driver.Manage().Window.Position = new Point(-2000,0);

Browser change position but after a while since browser  opens.
I want to open in different position

on January 21, 2016.

i guess you are looking some thing like this
driver.manage().window().setPosition(new Point(-2000, 0));

on January 22, 2016.
Add Comment
  • 1 Answer(s)

    Use Thread.sleep(time)

    IWebDriver driver =
    new FirefoxDriver();
    Thread.sleep(5000); //wait for 5 seconds

    Default Answered on March 7, 2016.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.