質問

3 security questions appearing on the screen like in random order like 1,3,2 or 2.1 and then 3:

  1. Pets name? 2. City you were born? 3. School you attend?

Lets say that answer is a last word of each question. How to code it in Selenium ide. I guess to use GoToif, GotoLabel and StoreEval? Also, the answer should be stripped to one last word without space and "?"

役に立ちましたか?

解決

You can store text or value in Selenium IDE.

  • The Command : storeText | storeValue (or storeAttribute if you want to stora an attribute of the element)
  • The Target must be a css or an xpath expression which can localize the appropriate element
  • The Value is the name of the new local variable in your Selenium IDE script

After using store command you can use your new variable like this: ${yourNewVariable}

For example:

storeAttribute  xpath=//div[@id='name-day']@name  nameday
echo  ${nameday}

You can use while loop and goto function in selenium ide with this addon : https://addons.mozilla.org/en-us/firefox/addon/flow-control/

Some commands:

  • gotoif
  • while
  • gotolabel

Example:

store   1   answers
while   storedVars.answers <= 3 
echo    ${answers}
... 
store   javascript{storedVars.answers++;}   
endWhile    
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top