简体   繁体   English

UFT使用IE浏览器的旧会话打开浏览器

[英]UFT opening browser with old session for IE Browser

I am automating a website where a user can login with different roles.But, after performing a operation with a specific roles when i am again opening the browser for another roles then UFT is opening browser with old session. 我正在自动化一个网站,用户可以在该网站上以不同的角色登录。但是,在执行了特定角色的操作后,当我再次为另一个角色打开浏览器时,UFT正在打开具有旧会话的浏览器。

Note : This issue is occurring if i am running all the test cases in a suite. 注意 :如果我正在套件中运行所有测试用例,则会出现此问题。 If i am running the scripts individually then it's working fine. 如果我单独运行脚本,那么它工作正常。

Moreover, I am also using a function to delete all the cookies and clear caches before opening the browser by using the command "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255" 此外,在使用命令"RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255"打开浏览器之前,我还使用了删除所有cookie并清除缓存的功能。

Please help on this. 请帮忙。

尝试使用Browser.DeleteCookies和/或Browser.ClearCache

It sounds like your application is saving your login details. 听起来您的应用程序正在保存您的登录详细信息。 If its saved in the browser, you could try this (probably will need some code to do this). 如果将其保存在浏览器中,则可以尝试执行此操作 (可能需要一些代码才能执行此操作)。 Once cleared, you should be able to launch your browser to the login page 清除后,您应该能够将浏览器启动到登录页面

ClearMyTracksByProcess has a patchy support for various IE versions. ClearMyTracksByProcess对各种IE版本都提供了补丁支持。 Did you check whether the cookies were indeed deleted? 您是否检查过cookie是否确实被删除?

For IE, you have various option: 对于IE,您有多种选择:

WebUtil.DeleteCookies

or as Motti pointed out 或如Motti所指出

Browser("Google.com").DeleteCookies "Google"
Browser("Google.com").ClearCache

You may also want to have a look at this article There are number of methods discussed on the article as well as in the comments section. 您可能还想看看本文 。在本文以及“注释”部分中讨论了许多方法。

For apps having different roles may be logging out before entering another session is good idea as Trimble Epic pointed out. Trimble Epic指出,对于具有不同角色的应用程序,可能需要先退出,然后再进入另一个会话。 If you have a separate logging page then may be close that logging page you used to go to your web app portal so that session is completed or cleared. 如果您有单独的日志记录页面,则可能会关闭用于访问Web应用程序门户的该日志记录页面,从而完成或清除会话。 Usually, if same id's are used to log into web app and same time if your id is used in other application of your organization that might also cause the issue. 通常,如果相同的ID用于登录Web应用程序,并且同一时间(如果您的ID用于组织的其他应用程序)也可能导致此问题。 I always used to forget to put log-out function on the end and used to get same issue time to time. 我总是忘记忘记将注销功能放在最后,并经常获得相同的发布时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM