cancel
Showing results for 
Search instead for 
Did you mean: 

Issues when attaching Web applications

MayankGoyal2
Level 8
Getting lot of issues with navitage - Attach stage of blue prism.
I used 2 websites -> www.google.com and www.amazon.com

1) For google I am using window title as -
2) For Amazon I am using window title as -

Firstly for both its not working with just window title, says more than 1 application found. I provided child index as 0 but ideally it should work without child index as my title is
unique.

Secondly when I have both google and amazon open and I am attaching amazon, it actually attached google and application modeller is identifying google page elements. When i close google page and have onlly amazon open, then it identifies amazon.

As per my understanding attach works with window title, I have 2 separate objects here, different window title, even then the behaviour is so unstable.
I have tried providing window title both ways - in collection (Window Titles) as well as in text field (Window Title).

In both cases both issues I mentioned above are there. Please suggest what is the correct way to attach with web based applications running on IE and Chrome browsers

------------------------------
Mayank Goyal
------------------------------
7 REPLIES 7

expertcr
Staff
Staff
Do you try to use the PIB for each window, Chrome and IE use more that one process for each tab.

19112.png


We have a KB article that touches this specific example: "How do I work with multiple Internet Explorer processes"

I hope this works for you.

------------------------------
Luis Lopez
Customer Support Engineer English and Spanish
Blue Prism Ltd
------------------------------

@Luis Lopez - Thanks a lot for your response. I checked the link mentioned and all details in link - https://help.blueprism.com/Automation-Design/Application-Integration/Internet-Explorer/1296680322/How-do-I-identify-a-specific-Internet-Explorer-process-to-attach-to.htm

The issue here is when I have to identify the PID to attach to, how should I do that by window title. When I tried the code mentioned in above link and have 2 IE open - one for AMAZON and one for GOOGLE, it is only giving me one window title i.e. of amazon. I did some research on google as well and few other users mentioned the same thing, i.e. it just gives window title of one IE instance even if multiple websites are running.  ​If you refer action Utility Environment - Read Memory Stats, that is also doing the same task with only difference programming is in VB and in above link its C#. 

I want to attach the correct IE to google or amazon at run time with their window title and without using Child Index, however the only way for it is to find PID. But with above issue we cant find PID.
Kindly suggest if there is some alternate to fix it.

------------------------------
Mayank Goyal
------------------------------

@Luis Lopez  @John Carter​ - Any inputs on above issue?

------------------------------
Mayank Goyal
------------------------------

Sorry for the delay, for that, I create a batch file, that looks for the PID base in the Window title.

EXAMPLE: I have IE open with two taps, one is in Amazon the other tab for NBC.

Create this batch file and run by BP using a code stage.

19116.png

-----------------------------------
@echo off
cls
cd\
cd temp
del testt.txt
echo RUNNING PROCESS PLEASE WAIT
echo Looking for IE PID for
echo POLITICAL WIRE Website
tasklist /v /fo csv | findstr /i "Amazon.com" > c:\temp\testt.txt
cls
exit
-----------------------------------

This creates a file like this:
-----------------------------------
"iexplore.exe","18740","Console","1","56,372 K","Running","BPUS0350\Luis Lopez Castro","0:00:02","Amazon.com: Online Shopping for Electronics, Apparel, Computers, Books, DVDs & more - Internet Explorer"
-----------------------------------

Then in BP read the TXT file to a data-item, later use a few calculation stages to see the length of the file, and look for the PID.

19118.png


I hope this work for you.

------------------------------
Luis Lopez
Customer Support Engineer English and Spanish
Blue Prism Ltd
------------------------------

@Luis Lopez ​- Thanks a lot for your response. I tried multiple things based on above discussion and have some observations - 

  • Command tasklist

This command has same issue which I mentioned above as well, i.e. it returns window title of only active window. I have 2 IE open in first I have searched 'Test' in search box and navigated to search page. The title for it is – 'test - Google Search - Internet Explorer'

2nd browser I have just launched google.com, the title for this is – 'Google - Internet Explorer'

When I check my task manager I am able to see both title clearly as in screenshot –

However when I check on cmd with command - tasklist /v /fo csv | findstr /i "iexplore.exe" I am able to see only 1 window title, rest shows NA.

Please suggest a way so that I can get all window titles for a process (like iexplore.exe) so that we can match title exactly and then pick up PID and use it to attach. PID is probably a good way of attaching as it will be unique but to get PID is a challenge here. Also any provision on BP to capture PID at time of launching application might help?

19126.png


  • Another issue I observed when working with multiple IE windows, is elements not getting identified.

If I have one IE opened with any website manually and I haven't closed it.

Now running a simple business object to launch google.com, type in search box doesn't work, attach was successful however not able to find text box.

When same object tried after closing other IE with any website open, then this object works perfect. Not sure if there are some issues with multiple instances of same application (in this case IE) open at a time.



------------------------------
Mayank Goyal
------------------------------

@Luis Lopez ​- Kindly suggest something for the above observation.

------------------------------
Mayank Goyal
------------------------------

Good morning, I try what you said, and is true, Windows only return the title of the last tab or window you utilize.
I have this idea:
1. Create a data-item1 with the title that you looking for and another data-item2 for the result of the tasklist command.
2. Run the command and compare the results with the data-item 1 if this is not the same, store the title display in the command in the data-item2
3. Attach to that PID with the only title available window and use SEND KEY to send to the next tab (CTRL + TAB)
4. Repeat steps 2 and 3 until to found the correct window tab.

Sorry I don't have a better suggestion but is a limitation with that command by Microsoft.

Another suggestion that at less in my Windows works is to open CMD as an administrator, this way when running the command goes faster.

Have a good day.


------------------------------
Luis Lopez
Customer Support Engineer English and Spanish
Blue Prism Ltd
------------------------------