Open GoogleCodeExporter opened 8 years ago
The Selenium API doesn't provide such feature.
The only way to identify the process is to keep track of the last created one.
Here is an example to keep track of the last instance of Firefox:
Sub test()
GetNewFirefox init:=True 'Stores all the Firefox instances
Set SeWD_ff = New SeleniumWrapper.WebDriver
SeWD_ff.Start "firefox", "http://uk.news.yahoo.com"
Set p= GetNewFirefox() 'Gets the newly created instance
Debug.Print p.WorkingSetSize 'Displays the working set
p.Terminate 'Terminates the process
End Sub
Function GetNewFirefox(Optional init As Boolean) As Object
Static q As String
If init Then q = "Select * from Win32_Process Where Name='firefox.exe'"
For Each p In GetObject("winmgmts:").ExecQuery(q)
q = q & " And ProcessId<>" & p.ProcessId
Set GetNewFirefox = p
Next
End Function
Original comment by florentbr
on 27 Jun 2015 at 1:40
Original issue reported on code.google.com by
ntkn88@gmail.com
on 2 Jun 2015 at 5:19