Clicking an Element on page load is even possible on webdriver; By default, webdriver wait for the entire page to load and then picks the element. The links and texts are visible but they are not clickable; However, it works well on Selenium IDE picking elements on page load.
Webdriver make use of the FirefoxProfile to avoid such risks; It's applicable only for Firefox browser.
FirefoxProfile fp = new FirefoxProfile();
fp.setPreference("webdriver.load.strategy", "unstable");
driver = new FirefoxDriver(fp);
baseUrl = "http://xyz.com";
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
driver.navigate().to("http://xyz.com");
driver.findElement(By.xpath(Value)).click();
System.out.println("Button got clicked");
Webdriver make use of the FirefoxProfile to avoid such risks; It's applicable only for Firefox browser.
FirefoxProfile fp = new FirefoxProfile();
fp.setPreference("webdriver.load.strategy", "unstable");
driver = new FirefoxDriver(fp);
baseUrl = "http://xyz.com";
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
driver.navigate().to("http://xyz.com");
driver.findElement(By.xpath(Value)).click();
System.out.println("Button got clicked");
Is there any way to make this happen in Internet Explorer ?
ReplyDeleteThanks in advance
Also I am trying for scripts to automate an already opened web page in IE. In order to skip the beginning formalities of logging in and working around to reach the page every time.
ReplyDeletePlease help me on this too .. thanks :)
Will add this soon... Cheers!
DeleteIn case of chrome use PageLoadStrategy.NONE;
ReplyDeleteHey Nice Blog!! Thanks For Sharing!!! Wonderful blog & good post. It is really very helpful to me, waiting for a more new post. Keep Blogging.DataScience with Python Training in Bangalore
ReplyDeletekyrie 5 spongebob
ReplyDeletekevin durant shoes
golden goose
goyard
a bathing ape
paul george
hermes handbags
yeezy boost 700
curry 6
kyrie spongebob