wugecat 发表于 2010-3-24 15:02:09

急!Browser的Title问题....

请教为什么相同浏览器有的机器识别的Browser的title是“XXX系统V1.0 - Windows Internet Explorer”有的是“XXX系统V1.0”??导致我的脚本不能重用。(大多数机器识别的是,XXX系统V1.0,少数是“XXX系统V1.0 - Windows Internet Explorer”)我希望都统一识别成“XXX系统V1.0”。。

yujie6832 发表于 2010-3-24 15:03:29

BROWSER你直接用描述性带过就可以了,即:BROWSER(BROWSERS:=BROWSER),不过这样的话,你只能开一个窗口哦

JonnyGu 发表于 2010-3-24 15:10:20

浏览器版本不同。。。

wugecat 发表于 2010-3-24 15:11:39

问题是我很多脚本都是通过Title来识别的,如果全部修改会很费力,而且用title大多数都可以,只有少数机器识别出来不一样,我想知道是,浏览器设置的问题,还是QTP设置的问题??

wugecat 发表于 2010-3-24 15:13:15

原帖由 JonnyGu 于 2010-3-24 15:10 发表 http://bbs.51testing.com/images/common/back.gif
浏览器版本不同。。。
都是一个版本。。

JonnyGu 发表于 2010-3-24 15:16:22

默认浏览器都一样吗?

wugecat 发表于 2010-3-24 15:18:47

都是一样的版本

JonnyGu 发表于 2010-3-24 15:23:46

如果机器系统一样,浏览器一样,版本一样,默认浏览器一样(最好只装一种),title还是不一样,我真不知道是为什么,盼高手来解决。。。

skyzhu 发表于 2010-3-24 15:26:43

将对象库里 Browser 的 title 属性改成正则
XXX系统V1.0.*
这样不管XXX系统V1.0后面跟什么都无所谓

wugecat 发表于 2010-3-24 15:30:08

会不会是QTP的设置问题呢?

wugecat 发表于 2010-3-24 15:31:36

原帖由 JonnyGu 于 2010-3-24 15:23 发表 http://bbs.51testing.com/images/common/back.gif
如果机器系统一样,浏览器一样,版本一样,默认浏览器一样(最好只装一种),title还是不一样,我真不知道是为什么,盼高手来解决。。。
我肉眼看到的title都一样,但是用QTP识别出来的有的就不同

mklodoss 发表于 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


"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/09/05/how-to-change-ie-7-window-title-text/
页: [1]
查看完整版本: 急!Browser的Title问题....