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
a71688
Regular Participant
Regular Participant
Posts : 27
Join date : 2014-07-23

Multiple condtions selenium ide help needed Empty Multiple condtions selenium ide help needed

Fri May 22, 2015 6:35 pm
Hi 


I have following problem

If host is like PP or ig then jump to label test. It seems it is giving me problems.


storeValue
environment
host



I tried 



gotoIf
(storedVars.host != "pp" || storedVars.host != "ig")
test


What am I doing wrong ?
avatar
ccox
Master
Master
Posts : 205
Join date : 2012-01-06
Age : 39
Location : Denver, CO

Multiple condtions selenium ide help needed Empty Re: Multiple condtions selenium ide help needed

Wed May 27, 2015 4:58 am
First, what is the problem, i.e. is there an error, does the condition always return true? Second,what are you storing? Try echo | ${host} after your first command and see what the result is. 
I would change out your gotoif with a getEval command and update a variable. Set that variable to the name of the label you want to go to.



store | 0 | labelName

getEval | if(storedVars.host!='pp' || stordVars.host!='ig'){storedVars.labelName="true"} else {storedVars.labelName="false"};

goto | ${labelName}

label | true

label | false
avatar
a71688
Regular Participant
Regular Participant
Posts : 27
Join date : 2014-07-23

Multiple condtions selenium ide help needed Empty Re: Multiple condtions selenium ide help needed

Wed May 27, 2015 9:10 pm
Hi CCOX

I will try to make my question clear what I want, by sumbitting my code. Values are read from my inputfile.

Then I want that if environment is different from PP or IG then it should jump to label test, but there seems to be an error since that if my env. is PP or IG it just jumps to label  test. What am I doing wrong ?

Code shown below (buttom) 







New Test





























































































































































































































































































































New Test
storeValuecvr2cvr2
storeValuecvrcvr
storeValuefirstmiddlenamefirstmiddlename
storeValuelastnamelastname
storeValuesimulatorsimulatorenviorment
storeValueTesttoolTesttool
storeValuetesttooltesttool
storeValuemailmail
storeValueenvironmenthost
storeValuechktesttoolchktesttool
storeValueDANIDDANID
storeValueRIDRID
storeValuePOCESPOCES
storeValueATBATB
storeValueBaseurlbaseurl
storeValueATBHATBH
storeValueErhvervsportalErhvervsportal
storeValueDanidadmDanidadm
storeValueRIDHRIDH
storeValueNOFNOF
storeOCtmltp16tsvkbttcaptcha
gotoIfstoredVars.host!='pp' || storedVars.host!='ig'test
open${ATBH}
waitForTextcss=preAll is well
https://localhost:9292/attributeservice_serviceprovider_server/:
All is well
verifyTextcss=preAll is well
https://localhost:9292/attributeservice_serviceprovider_server/:
All is well
open${Erhvervsportal}
waitForTextcss=preAll is well
https://vz2mapp:9290/eo2_selfservice_webservice/:
All is well
https://localhost:9292/attributeservice_serviceprovider_server/:
All is well
https://localhost:9298/rid_ca_server/:
All is well
verifyTextcss=preAll is well
https://vz2mapp:9290/eo2_selfservice_webservice/:
All is well
https://localhost:9292/attributeservice_serviceprovider_server/:
All is well
https://localhost:9298/rid_ca_server/:
All is well
open${Danidadm}
waitForTextcss=htmlAll is well
https://localhost:9292/attributeservice_serviceprovider_server/:
All is well
TCP check http://ibss:8085 :true
verifyTextcss=preAll is well
https://localhost:9292/attributeservice_serviceprovider_server/:
All is well
TCP check http://ibss:8085 :true
open${RIDH}
waitForTextcss=preAll is well
verifyTextcss=preAll is well
open${NOF}
waitForTextcss=preAll is well
verifyTextcss=preAll is well
labeltest
open${DANID}
waitForPageToLoad30000
storeTextPresentNemID-administration og telefon-supportLogon
gotoIfstoredVars.Logontrue
getEvalalert("Du skal logge på DanID adm igen")
break
echoMANUAL STEP - TO DOLogin med TESTMOCES3 / PW: Test1234
labeltrue
clickAndWaitlink=Søg virksomhed
typeid=cvr${cvr2}
clickAndWaitcss=input[type="submit"]
storeTextPresentAktivcvrStore1
gotoIf!storedVars.cvrStore1true
getEvalalert("CVR "+${cvr2}+" er allerede i brug - find et andet og start forfra med INPUT filen.")
labeltrue
clickAndWaitlink=Forside
clickAndWaitlink=Søg virksomhed
typeid=cvr${cvr}
clickAndWaitcss=input[type="submit"]
storeTextPresentAktivcvrStore2
gotoIf!storedVars.cvrStore2OK
getEvalalert("CVR "+${cvr}+" er allerede i brug - find et andet og start forfra med INPUT filen.")
labelOK

avatar
a71688
Regular Participant
Regular Participant
Posts : 27
Join date : 2014-07-23

Multiple condtions selenium ide help needed Empty Re: Multiple condtions selenium ide help needed

Thu May 28, 2015 11:46 pm
You can use ccox solution that also Works or use following:



gotoif | !(storedVars.host=='pp' || storedVars.host=='ig')|test
Sponsored content

Multiple condtions selenium ide help needed Empty Re: Multiple condtions selenium ide help needed

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