Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

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

else if command Empty else if command

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


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

else if command Empty Re: else if command

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

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

else if command Empty Re: else if command

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
avatar
ccox
Master
Master
Posts : 205
Join date : 2012-01-06
Age : 39
Location : Denver, CO

else if command Empty Re: else if command

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
avatar
anbarasi
Amateur
Amateur
Posts : 49
Join date : 2012-04-30
Age : 36
Location : chennai

else if command Empty Re: else if command

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
avatar
anbarasi
Amateur
Amateur
Posts : 49
Join date : 2012-04-30
Age : 36
Location : chennai

else if command Empty Re: else if command

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

else if command Empty Re: else if command

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