如何在selenium IDE中依次迭代值

时间:2014-11-18 12:34:57

标签: selenium selenium-ide

如何在selenium-IDE中依次迭代值     输入id = name22 441
    输入id = name32 442
    输入id = name42 443
    输入id = name52 444
    输入id = name62 445
    输入id = name72 446
    输入id = name82 447
    输入id = name92 448
    输入id = name102 449
    我怎样才能在selenium -IDE中按顺序迭代值。这里我想按顺序迭代值。我能实现它吗?

When i try this code but it is not working
store   440 i
store   javascript {storedVars.i++;}    
echo    ${i}    
type    id=name22   ${i}
type    id=name32   ${(i)+}

1 个答案:

答案 0 :(得分:0)

请尝试以下代码:

store    440    i
store    0      looptimes
store    22     customVariable
while    storedVars.looptimes<==8
store    javascript{storedVars.i++}
storeEval    storedVars['i']=${i}
type    id=name${customVariable}     ${i}
store     ${customVariable}+10    customVariable
storeEval    storedVars['customVariable']=${customVariable}
store    javascript{storedVars.looptimes++;}
endWhile

我是从头开始写的,所以如果你需要澄清,请评论我的答案