Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

else if command

View previous topic View next topic Go down

else if command

Post by anbarasi 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



anbarasi
Amateur
Amateur

Posts : 40
Join date : 2012-04-30
Age : 28
Location : chennai

Back to top Go down

Re: else if command

Post by ccox 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


ccox
Master
Master

Posts : 205
Join date : 2012-01-06
Age : 31
Location : Denver, CO

Back to top Go down

Re: else if command

Post by anbarasi 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

anbarasi
Amateur
Amateur

Posts : 40
Join date : 2012-04-30
Age : 28
Location : chennai

Back to top Go down

Re: else if command

Post by ccox 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

ccox
Master
Master

Posts : 205
Join date : 2012-01-06
Age : 31
Location : Denver, CO

Back to top Go down

Re: else if command

Post by anbarasi 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 : 40
Join date : 2012-04-30
Age : 28
Location : chennai

Back to top Go down

Re: else if command

Post by anbarasi on Fri Apr 05, 2013 1:14 pm

Hi it works perfectly now... thanks much .....

anbarasi
Amateur
Amateur

Posts : 40
Join date : 2012-04-30
Age : 28
Location : chennai

Back to top Go down

Re: else if command

Post by Sponsored content Today at 1:03 am


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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