Share
Go down
anbarasi
Amateur
Amateur
Posts : 49
Join date : 2012-04-30
Age : 30
Location : chennai

else if command

on Thu Apr 04, 2013 10:02 pm
Hi i need to raise an alert msg using selenium ide on my java web application and clicking on alert buttons redirects to yes or no page....can anyone guide me


thanks


ccox
Master
Master
Posts : 205
Join date : 2012-01-06
Age : 33
Location : Denver, CO

Re: else if command

on Thu Apr 04, 2013 10:15 pm
In your application, clicking on something creates an alert?

Or are you trying to put up a js alert using selenium ide to direct your flow while the script runs? For instance while your script is running, you can put up an alert in Selenium IDE where you can enter text and trigger a flow off of that

anbarasi
Amateur
Amateur
Posts : 49
Join date : 2012-04-30
Age : 30
Location : chennai

Re: else if command

on Thu Apr 04, 2013 10:42 pm
yes ur second point is correct i want selenium to show an alert or confirm msg like to the user whether they need to proceed and if click on ok or cancel it should go to a separate page
ccox
Master
Master
Posts : 205
Join date : 2012-01-06
Age : 33
Location : Denver, CO

Re: else if command

on Thu Apr 04, 2013 11:25 pm
This is definitely doable. It's been a while since I have tried this, but I should be able to get you started. Start off with a storing an arbitrary value to be the route you are directed to. Then display a prompt where you can type y or n. if y assign your route variable to yes, if n(or anything else) assign your route variable to no. Once it gets to the gotolabel function it will be directed to the appropriate flow.

store | i | route
storeEval | prompt("type y or n", "y"); | answer
getEval | if(storedVars['answer'] == "y"){storedVars['route']="yes";} else {storedVars['route']="no";}
gotolabel | ${route}
label | yes
//some code for yes route
label | no
//some code for no route


Let me know if this works
anbarasi
Amateur
Amateur
Posts : 49
Join date : 2012-04-30
Age : 30
Location : chennai

Re: else if command

on Fri Apr 05, 2013 12:13 pm
HI i tried this code but it is not redirecting yes value.

store | i | route
storeEval | prompt("type y or n", "y"); | answer
getEval | if(storedVars['answer'] == "y"){storedVars['route']="yes";} else {storedVars['route']="no";}
gotolabel | ${route}
label | yes
click | id=menu1-2-0-1 // im not getting yes value page , im getting only no valued page
label | no
click | id=menu1-0
anbarasi
Amateur
Amateur
Posts : 49
Join date : 2012-04-30
Age : 30
Location : chennai

Re: else if command

on Fri Apr 05, 2013 1:14 pm
Hi it works perfectly now... thanks much .....
Sponsored content

Re: else if command

Back to top
Permissions in this forum:
You cannot reply to topics in this forum