感谢您查看我的查询.在一个网页上,有超过200个链接,我确保所有链接都在工作.获取href值后这很容易,但问题是,'href'值不包含link'javaScript函数'这里是源代码
<a tabindex="8" title="Internal Crossload" target="_self" href="javascript:fnnHomePage('3' , 'WTMS_EXPRESS')"> - Internal Crossload </a>
Run Code Online (Sandbox Code Playgroud)
JavaScript函数:
<Script>
/*********************************************************************
Function Name : fnnHomePage
Input Parameter(s) : transferTypeId
Output Parameter(s) : None
**********************************************************************/
function fnnHomePage(transferTypeId ,moduleName) {
if (moduleName == "XXX_EXPRESS")
{
document.getElementById("transferTypeId").value=transferTypeId;
document.getElementById("gadgetType").value="XXX_EXPRESS";
document.getElementById("moduleName").value="XXX_EXPRESS";
document.forms[0].action="/XXX/getProposalHomePage.do?transferTypeId="+transferTypeId;
document.forms[0].submit();
}
if (moduleName == "CROSSLOAD")
{
document.getElementById("transferTypeId").value=transferTypeId;
document.getElementById("gadgetType").value="CROSSLOAD";
document.getElementById("moduleName").value="CROSSLOAD";
document.forms[0].action="/XXX/getCrossLoadHomePage.do?transferTypeId="+transferTypeId;
document.forms[0].submit();
}
}
</Script>
Run Code Online (Sandbox Code Playgroud)
从上面的代码,我如何获得' 链接 '并检查它是否在selenium webdriver中正常工作?有几个链接,每个链接称为不同的"JavaScript功能".任何建议将不胜感激.谢谢.
我已经阅读了错误处理概念,并且似乎没有弄清楚在执行测试脚本时如何在发生错误时调用函数.这是我的要求
script 1
code with error
immediately call a function that sends an email