我正在尝试从表中提取一些内容,用于在选择的多个框中选择项目。
这很好用:
VERSION BUILD=9030808 RECORDER=FX
TAB T=1
URL GOTO=https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select_multiple
FRAME NAME="iframeResult"
TAG POS=1 TYPE=SELECT FORM=ACTION:/action_page.php ATTR=NAME:cars CONTENT=%volvo:%opel
为什么在将提取内容创建为变量时,它不起作用:
名为SET CARS volvo:%opel
VERSION BUILD=9030808 RECORDER=FX
TAB T=1
URL GOTO=https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select_multiple
FRAME NAME="iframeResult"
SET CARS volvo:%opel
TAG POS=1 TYPE=SELECT FORM=ACTION:/action_page.php ATTR=NAME:cars CONTENT=%{{CARS}}
错误讯息:
Entry [volvo:%opel] not available [Box has 4 entries], line: 6 (Error code: -924)
答案 0 :(得分:0)
另外我可以建议另一种方式:
' ... '
FRAME NAME="iframeResult"
SET CARS "volvo,opel"
EVENT TYPE=CLICK XPATH=EVAL("'//HTML/BODY/FORM/SELECT/OPTION[@value=\\'' + '{{CARS}}'.split(',')[0] + '\\']';") BUTTON=0 MODIFIERS="ctrl"
EVENT TYPE=CLICK XPATH=EVAL("'//HTML/BODY/FORM/SELECT/OPTION[@value=\\'' + '{{CARS}}'.split(',')[1] + '\\']';") BUTTON=0 MODIFIERS="ctrl"
根据wiki documentation,您必须编写如下代码:
' ... '
FRAME NAME="iframeResult"
SET CAR1 "volvo"
SET CAR2 "opel"
TAG POS=1 TYPE=SELECT FORM=ACTION:/action_page.php ATTR=NAME:cars CONTENT=%{{CAR1}}:%{{CAR2}}
答案 1 :(得分:0)
使用脚本界面找到了一种方法。只需添加项目列表即可选择JS:
function createMultiSelector(list) {
macro = "CODE:";
macro += "URL GOTO=https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select_multiple\n";
macro += "FRAME = 'iframeResult'\n";
macro += "TAG POS=1 TYPE=SELECT FORM=ACTION:/action_page.php ATTR=NAME:cars CONTENT=%"+list+"\n";
iret = iimPlay(macro);
}