1

In one of our test machines, 2 browsers are counted though only 1 is displayed, causing UFT not to identify and enter value to objects since we are using RegEx:

Browser("title:=.*").Page....

We are using the below line to initialize IE:

InvokeApplication "C://Program Files/Internet Explorer/IEXPLORE.EXE"

What is the workaround for this?

UFT version is 12.02.

Thanks in advance!

ManishChristian
  • 3,759
  • 3
  • 22
  • 50
Glenn P
  • 37
  • 8
  • not much info to help you out. I am assuming you did take the count of browser (which you got as 2). Why dont you try using creationtime instead of Title ? – Pranav Sep 15 '17 at 08:23
  • Check in task manager if there is an extra `iexplore.exe` process running or not. – Gurmanjot Singh Sep 15 '17 at 10:05
  • @Pranav - all of our scripts use title, it would take much time to update all and might impact the scripts. I am first searching for a workaround though that is my last option. Thanks – Glenn P Sep 15 '17 at 12:50
  • @Kira - There are other instances of iexplore.exe, some with *32 in the task manager. Is this a Windows OS problem? – Glenn P Sep 15 '17 at 12:51
  • That's why you are facing the problem...just before running the script, kill all the instances of iexplore.exe. Try it and let me know if it worked for you. No, this is not an OS problem. – Gurmanjot Singh Sep 15 '17 at 12:52
  • @GlennC i think it wouldn't take as much time at all as you just need to replace the statement (find and replace) - couple of trivial things you might want check first - are you opening multiple instances of browser without terminating previous ones ? or Is your ALM Client open in IE while you execute ? you might want to close that as well. – Pranav Sep 18 '17 at 12:16

3 Answers3

0

I would first close all the open instances of IE by using:

SystemUtil.CloseProcessByName("iexplore.exe")

And then open the new instance using:

SystemUtil.Run "iexplore.exe","TestURL","C:\","",3

Check this link for more information on SystemUtil.

ManishChristian
  • 3,759
  • 3
  • 22
  • 50
  • Thanks. Will this ignore ALM if the setting to ignore ALM in UFT is on? Or I have to add some code to ignore ALM? – Glenn P Sep 18 '17 at 03:01
  • @GlennC, this will close ALM (opened in IE) as well. To handle this I would suggest to use ALM Explorer, so you need to worry about it getting closed if opened using IE. Check my [**`answer`**](https://stackoverflow.com/a/32056517/1652222) on this issue. – ManishChristian Sep 18 '17 at 13:14
0

Follow below steps:-

1) close all the process of IE using WMI object.

Set ObjWMI= GetObject("WInmgmts:")
Set oProcess = ObjWMI.ExecQuery("Select * from win_32 Process")
For each p in oProcess 
    if p.name = "iexplorer.exe" Then p.terminate
Next

2) webUtil.deleteCokkies

3) Then open your application using systemUtil.run..

Hope it will help

ManishChristian
  • 3,759
  • 3
  • 22
  • 50
Dharm
  • 1
0

Thanks for all your input. I learned a lot from you. I already found the root cause. It was after all not the multiple open browsers but a timing issue with the log in page for one of the machines. The email address text box object is visible however, it cannot be identified by UFT immediately that is why I added a sync point to wait max of 4 minutes until object.Exist(240)=true. Thank you all!

Glenn P
  • 37
  • 8