My test automation requirement was following

  1. Open IE as user A from QTP
  2. Perform some actions & close IE
  3. Open IE as user B from QTP in the same test
  4. Perform some actions
  5. close IR

I am successfully able to implement step1 to step3 using impersonation. http://www.sqaforums.com/download.php?Number=700264 (.net dll approach)

I have verified this impersonation works fine with client server based actions (e.g. data base call, file access etc), but when I open IE qtp stops recognizing the object on IE (browser is recognised as window). I believe this is due to the reason that QTP hooks are injected into IE with user context A. Is there a way I can overcome this & make qtp recognize IE objects correctly ?

Thanks in advance.

有帮助吗?

解决方案

I also had a similar problem...

The scenario is when i start IE and then open QTP, QTP recognizes the explorer as Window

But if i open QTP first and then open IE, it recognizes as Browser...

So restarting QTP might solve the problem. So my suggestion is to use driver script and include the impersonation level in driver script

  1. open QTP using driver script.. then Open IE as user A
  2. perform actions, close IE using QTP and store the results in Excel and close QTP using driver script
  3. Perform impersonation in driver script and open QTP and then IE.
  4. perform actions

hope this solves the problem and thanks for sharing the impersonation doc.. it was good to learn something new!!!

其他提示

How about you don't close the IE just log out from user A and login again from user B.

Regards.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top