0

我在下面有以下 HTML,我试图在我登陆页面时验证标题是否存在。这是在 IE 11 中

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="ctl00_Head1"><title>
	Smart Tracking System
</title><meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" /><link rel="shortcut icon" type="image/x-icon" href="../images/desktopicon.ico" /><link href="../App_Themes/appthemes/appstyles.css" type="text/css" rel="stylesheet" /><link href="../App_Themes/appthemes/calendarstyles.css" type="text/css" rel="stylesheet" /><link href="../App_Themes/appthemes/tabsstyles.css" type="text/css" rel="stylesheet" /></head>
<body>

当我从 Firefox 源代码复制 xpath 时,它说 xpath 是:/html/head/title

我正在使用 C# 代码进行验证,但我不断收到“LoadableComponentException ...”

private By textlabelPageHeader = By.XPath("//h1[@class='title' and text()='Smart Tracking System']");

我不做什么??请任何帮助将不胜感激

4

0 回答 0