15-07-22 10:19 AM
15-07-22 11:18 AM
15-07-22 11:38 AM
title = Process.GetProcessById(3016).MainWindowTitle;
15-07-22 01:32 PM
01-03-23 01:53 AM
Hi @Diane Sanzone The opened tabs are only two but in Process Statistics collection there are many rows with PID, Please help me to understand it better. How can I attach to a dynamic window title using this PID feature.
01-03-23 01:33 PM
Hi Sivaranjani,
I'll admit I don't understand why, but when you open an Edge or Chrome window it will spawn multiple processes on your machine (as is visible through the details tab of task manager). Each additional tab in the browser will spawn multiple new processes, and I don't think there's any ratio for it. In my experience, you don't need to know which processes go with each tab. For BP purposes you can just loop through each ID and see if it's the right one by checking for a valid element. It's hard to explain, so I'll attempt to describe the logic flow.
Assuming you know the window title, you can do this pretty easily with a loop around your attach stage:
One thing to note - one of the records returned in the Process Statistics collection will have a PID of 0. You should add logic to skip that process. It's the "idle" process and doesn't correspond to any browser window. There are many ways to do that (filter the collection for anything where PID <> 0 to start, check the PID before attempting attach, etc.). It's up to you how to best complete that part.
I hope this helps clarify.
------------------------------
Diane Sanzone
------------------------------