51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

查看: 4567|回复: 11
打印 上一主题 下一主题

[求助] 急!Browser的Title问题....

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2010-3-24 15:02:09 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
1测试积点
请教为什么相同浏览器有的机器识别的Browser的title是“XXX系统V1.0 - Windows Internet Explorer”有的是“XXX系统V1.0”??导致我的脚本不能重用。(大多数机器识别的是,XXX系统V1.0,少数是“XXX系统V1.0 - Windows Internet Explorer”)我希望都统一识别成“XXX系统V1.0”。。

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2010-3-24 15:03:29 | 只看该作者
BROWSER你直接用描述性带过就可以了,即:BROWSER(BROWSERS:=BROWSER),不过这样的话,你只能开一个窗口哦
回复

使用道具 举报

该用户从未签到

3#
发表于 2010-3-24 15:10:20 | 只看该作者
浏览器版本不同。。。
回复

使用道具 举报

该用户从未签到

4#
 楼主| 发表于 2010-3-24 15:11:39 | 只看该作者
问题是我很多脚本都是通过Title来识别的,如果全部修改会很费力,而且用title大多数都可以,只有少数机器识别出来不一样,我想知道是,浏览器设置的问题,还是QTP设置的问题??
回复

使用道具 举报

该用户从未签到

5#
 楼主| 发表于 2010-3-24 15:13:15 | 只看该作者
原帖由 JonnyGu 于 2010-3-24 15:10 发表
浏览器版本不同。。。

都是一个版本。。
回复

使用道具 举报

该用户从未签到

6#
发表于 2010-3-24 15:16:22 | 只看该作者
默认浏览器都一样吗?
回复

使用道具 举报

该用户从未签到

7#
 楼主| 发表于 2010-3-24 15:18:47 | 只看该作者
都是一样的版本
回复

使用道具 举报

该用户从未签到

8#
发表于 2010-3-24 15:23:46 | 只看该作者
如果机器系统一样,浏览器一样,版本一样,默认浏览器一样(最好只装一种),title还是不一样,我真不知道是为什么,盼高手来解决。。。
回复

使用道具 举报

该用户从未签到

9#
发表于 2010-3-24 15:26:43 | 只看该作者
将对象库里 Browser 的 title 属性改成正则
XXX系统V1.0.*
这样不管XXX系统V1.0后面跟什么都无所谓
回复

使用道具 举报

该用户从未签到

10#
 楼主| 发表于 2010-3-24 15:30:08 | 只看该作者
会不会是QTP的设置问题呢?
回复

使用道具 举报

该用户从未签到

11#
 楼主| 发表于 2010-3-24 15:31:36 | 只看该作者
原帖由 JonnyGu 于 2010-3-24 15:23 发表
如果机器系统一样,浏览器一样,版本一样,默认浏览器一样(最好只装一种),title还是不一样,我真不知道是为什么,盼高手来解决。。。

我肉眼看到的title都一样,但是用QTP识别出来的有的就不同
回复

使用道具 举报

该用户从未签到

12#
发表于 2010-3-24 16:16:26 | 只看该作者
title是html中的
<title>XXX</title>标签的内容中读的,至于- Windows Internet Explorer是浏览器自加的吧。可以修改的。

E.g, replace IE window title text with the company name to impress customers who are using the Internet kiosks.

Or better still, impress your love with his/her name written on IE window title!
How to change or customize IE 7 window title text?

Here are 3 ways to do so, and each of them are applicable to Internet Explorer web browser running in Windows (if not Windows, what else?).

Double-click Windows Registry file

Copy these lines of Windows Registry file content to Notepad and save it with .reg file extension (Windows Registry file), e.g. Change-IE-Window-Title.reg in my case. Remember to replace “Walker News” with yours own text!

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]
"Window Title"="Walker News"


Double click the Windows Registry file to customize or change the IE 7 title text.

If the Vista UAC is not tweaked or disabled, a Consent UI dialog box will pop up to ask for acknowledgement. Follow by is the Registry Editor’s warning message that said something like “Adding information can unintentionally change or delete values and cause components to stop working correctly.”

Edit Windows Registry window title key to customize IE window title text.

Just click YES button to proceed. Subsequently, open a new IE 7 browser and the window title text should have changed from “Windows Internet Explorer” to your customized text!

Registry Console Tool or Reg.exe command

Copy this line of Reg.exe command text to Windows Vista elevated Command Prompt window and press ENTER key:
(refer to “How to copy and paste text in Command Window”)

REG ADD "HKCU\Software\Microsoft\Internet Explorer\Main" /v "Window Title" /t REG_SZ /d "Walker News" /f


Manually edit with Windows Registry Editor

1) Type regedit in Vista Instant Search and press ENTER to open the Windows Registry Editor.

2) Navigate the tree-structure at left pane with this path

HKEY_Current_User\Software\Microsoft\Internet Explorer\Main


3) Look for “Window Title” Registry key at the right pane. Create a string value type of Registry key and name it as “Window Title” if it isn’t there.

4) Double-click the “Window Title” Registry key and enter the customize text that will appears in IE window title.
附上链接: http://www.walkernews.net/2007/0 ... -window-title-text/
回复

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-5-18 04:45 , Processed in 0.079704 second(s), 25 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表