- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Get PID of Browser launched by Selenium.
We can PID of browsers launched by Selenium webdriver. First of all, we have to create an object of the webdriver. Next, for example, to launch the browser in the Firefox browser, we have to take the help of webdriver.Firefox() class.
The location of the geckodriver.exe file is passed as a parameter to that class. This is done by setting the path to executable_path property. Then, the browser shall be launched with the get method.
Finally, to obtain the PID of the browser, we shall use the driver.service.process.id method.
s = driver.service.process.pid
from selenium import webdriver #path of geckodriver.exe driver = webdriver.Firefox(executable_path="C:\\geckodriver.exe") #launch browser driver.get ("https://www.tutorialspoint.com/index.htm") #obtain PID of browser s = driver.service.process.pid print(s) #close browser driver.close()
- Python selenium browser driver.back().
- Selenium testing without browser.
- Browser Plugin Testing With Selenium.
- Use Selenium with Chromium Browser.
- Does Selenium support Safari browser?
- Handling Browser Authentication using Selenium
- How to get page source as it is in browser using selenium?
- Does Selenium support headless browser testing?
- How to perform browser navigations in Selenium?
- How to maximize the browser in Selenium?
- How to launch Chrome Browser via Selenium?
- How to start selenium browser with proxy?
- What is PID manager in Linux?
- How to set the size of the browser window in Selenium?
- How does selenium interact with the Web browser?