您的位置:軟件測試 > 開源軟件測試 > 開源功能測試工具 > Selenium
Selenium利用javascript控制滾動條
作者:網(wǎng)絡轉載 發(fā)布時間:[ 2013/9/11 10:56:05 ] 推薦標簽:

  以下備注所用test.html 的代碼(我也是在網(wǎng)上找的,簡單的修改顯示文字而已),供大家使用:

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Selenium Study</title>
<script language="JavaScript">
function check(){
var clientHeight = document.getElementById('text').clientHeight;
var scrollTop    = document.getElementById('text').scrollTop;
var scrollHeight = document.getElementById('text').scrollHeight;
if(clientHeight + scrollTop < scrollHeight){
alert("Please view top news terms !"); return false;
}else{
alert("Thanks !");
}
}
function set()
{
document.getElementById('text').scrollTop=10000;
}
</script>
</head>
<body>
<form id="form1" method="post" onsubmit="return check();">
<textarea id="text" name="text" cols="70"  rows="14">
Selenium IDE is the a Firefox plugin that does record-and-playback of interactions with the browser. Use this to either create simple scripts, assist in exploratory testing. It can also export Remote Control or WebDriver scripts, though they tend to be somewhat brittle and should be overhauled into some sort of Page Object-y structure for any kind of resiliency.
Selenium IDE is the a Firefox plugin that does record-and-playback of interactions with the browser. Use this to either create simple scripts, assist in exploratory testing. It can also export Remote Control or WebDriver scripts, though they tend to be somewhat brittle and should be overhauled into some sort of Page Object-y structure for any kind of resiliency.
Selenium IDE is the a Firefox plugin that does record-and-playback of interactions with the browser. Use this to either create simple scripts, assist in exploratory testing. It can also export Remote Control or WebDriver scripts, though they tend to be somewhat brittle and should be overhauled into some sort of Page Object-y structure for any kind of resiliency.
Selenium IDE is the a Firefox plugin that does record-and-playback of interactions with the browser. Use this to either create simple scripts, assist in exploratory testing. It can also export Remote Control or WebDriver scripts, though they tend to be somewhat brittle and should be overhauled into some sort of Page Object-y structure for any kind of resiliency.
</textarea><br /><br />
<input type="submit" id="submit" name="submit" value="Submit" />
</form>
</body>
</html>

上一頁123下一頁
軟件測試工具 | 聯(lián)系我們 | 投訴建議 | 誠聘英才 | 申請使用列表 | 網(wǎng)站地圖
滬ICP備07036474 2003-2017 版權所有 上海澤眾軟件科技有限公司 Shanghai ZeZhong Software Co.,Ltd