DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Culture and Methodologies
  3. Agile
  4. Any Advantages of Using taskkill.exe Over the Close Method in Selenium?

Any Advantages of Using taskkill.exe Over the Close Method in Selenium?

Learn more about one tester's thoughts on using taskkill.exe over the close method in Selenium.

Alan Richardson user avatar by
Alan Richardson
·
Feb. 15, 19 · Opinion
Like (1)
Save
Tweet
Share
6.08K Views

Join the DZone community and get the full member experience.

Join For Free

Q: When getting rid of a browser, what are the advantages of using taskkill.exe over the close method in Selenium?

A: I can’t really think of any advantages to using taskkill.exe over a close or quit method in Selenium.

If the browser was opened by Selenium, then I would try to have Selenium close it.

If the browser is unresponsive after executing Selenium code, then it may suggest a problem with the application under test, making the browser unresponsive, which would imply issues with the application that need to be investigated.

Another issue might be caused potentially by a mismatch between the driver version and the browser version, so the environment used to execute the code from may need to be investigated.

TaskKill.exe would make your Selenium code dependent on a Windows environment and would likely prevent you from running your Selenium execution through a local grid or a cloud grid.

If I was working on a project and saw that the code was using TaskKill.exe to close browsers, I would be investigating:

  • What happens if you just use close or quit, i.e. is it really necessary?
  • Why do people think this is necessary? Then, I would explain some of the risks and issues I mentioned above
  • If it is necessary, because quit or close do not terminate the browser session, then what changes do we have to make to our application or environment so that it is not necessary.

You should not really have to use taskkill.exe to close Selenium WebDriver initiated sessions.

Taskkill, or any process termination command, may be necessary if you using it as a temporary workaround because you are experiencing any of the issues I mentioned above. But it should really only exist as a temporary measure until you solve the problem that is causing the close or quit command to not terminate the browser.

This article was syndicated from blog.eviltester.com. Author Alan Richardson is an Agile Software Development and Testing Consultant he has written 4+ books including Dear Evil Tester, Automating and Testing a REST API, Java For Testers. He has created 6+ online training courses covering Technical Web Testing, Selenium WebDriver and other topics. He is a prolific content creator on his blog, Youtube and Patreon.

Advantage (cryptography) agile

Published at DZone with permission of Alan Richardson, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Top 5 Node.js REST API Frameworks
  • Top 10 Secure Coding Practices Every Developer Should Know
  • 5 Factors When Selecting a Database
  • How Observability Is Redefining Developer Roles

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: