Webdriver - Kill IE process
Later I am know that this is not a good idea.
Better implement the following
InternetExplorerDriver driver;
@BeforeClass(alwaysRun = true)
protected void setUp() throws Exception {
driver = new InternetExplorerDriver();
}
@AfterClass(alwaysRun = true)
protected void tearDown() throws Exception {
driver.quit();
xKillIEs();
}
I am working on Webdriver pageobjects, if test case get failed, system will not close the browser because it has not reached the statement driver.close.
There are lot of opened IE's at the end of test execution.
To overcome this issue, I have created following utility program that is called before every test execution to eliminate any opened IE's.
There are lot of opened IE's at the end of test execution.
To overcome this issue, I have created following utility program that is called before every test execution to eliminate any opened IE's.
public void xKillIEs() throws Exception
{
final String KILL = "taskkill /IM ";
String processName = "iexplore.exe"; //IE process
Runtime.getRuntime().exec(KILL + processName);
Wait(3000); //Allow OS to kill the process
}
Later I am know that this is not a good idea.
Better implement the following
InternetExplorerDriver driver;
@BeforeClass(alwaysRun = true)
protected void setUp() throws Exception {
driver = new InternetExplorerDriver();
}
@AfterClass(alwaysRun = true)
protected void tearDown() throws Exception {
driver.quit();
xKillIEs();
}
---
Hi Bharath,
ReplyDeletethanks for the info on your blog, it's very useful.
I have a question, I wonder whether there is an answer to that. Sorry about the question not being related to the above post.
I want to create an automated tool for my browser for Android (I wrote it myself). Can I use WebDriver for that? (or WebDriver can only work with the established browsers?)
I can open an URL in the stock browser and check the name and values of the HTML elements, but I wonder whether I can do the same with my browser.
Thanks a lot,
Chris
Hello Chris,
ReplyDeleteAs per my understanding it will work for established browsers. I would suggest to understand how webdriver communicate with original android browser and compare the changes with your custom browser. There is lot of difference how webdriver communicate with different browsers.
Thanks, Bharath. It makes sense.
ReplyDeleteI'll do that.
And I appreciate the swift reply.
Best regards and congrats on your blog,
Chris
It wouldn't work if you are running them in a remote location aka RemoteWebDriver+Grid2. Do you have any solution for that?
ReplyDeleteTrue.
Delete1. Copy the in the remote location.
or
2. Using psTools create a script to copy or create a file in the remote location