编码用户界面:如何验证是否打开了具有特定标题的选项卡 [英] Coded UI: How to verify if a Tab with a specific title is opened
问题描述
我正在尝试验证是否打开了具有特定标题的标签
我正在使用
if(BrowserWindow.Locate ("标题")。TryFind())
但是当找不到标签时代码返回异常
您好VioVar,
>> if(BrowserWindow.Locate(" Title") ;)。TryFind())
根据这段代码,如果带有标题的标签不是你打开的当前页面,它会抛出异常,我只是在我的机器上测试它的错误异常消息是:
因此,请确保当前的浏览器页面与您在代码中指定的标题一致。
为确保我们能够正确理解此问题,您可以与我们分享更多代码,以及 p>
问候,
Fletcher
I am trying to verify if a tab with a specific title is opened
I am using
if (BrowserWindow.Locate("Title").TryFind())
But the code is returning an exception when the tab is not found
Hi VioVar,
>>if (BrowserWindow.Locate("Title").TryFind())
Based on this code, if the tab with the Title is not the current page you've open, it will throw exception, I just test it in my machine the error exception message is:
So please make sure that the current browser page is that with the Title you specified in your code.
To make sure that we understand this issue correctly, you could share us more code, and the specific info of the exception like mine.
Regards,
Fletcher
这篇关于编码用户界面:如何验证是否打开了具有特定标题的选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!