Module21- PortfolioName value is not fetching from excel | Selenium Forum
M
Posted on 25/02/2016
[attachment=3:2o5tclbr]PortFolioTest.java[/attachment:2o5tclbr]In Module 21- In createnewPortfolio scenario, portfolio text box got cleared but not fetching the new portfolio name that I have passed in the xlsx file. null value is passed. I have tried even in debug mode, but could n't identify where the the error in code . I have attached my code files could you please help me to resolve this issue

project.properties:
#defaut
username=lr.seleniumtest
password=seleniumtest

chromedriverexe=C://Ramana Softwares//Selenium webdriver//chromedriver.exe

#URLS
env=prod
url_prod=http://in.rediff.com

#Links
moneyLink_xpath=//*[@id='homewrapper']/div[5]/a[3]/div
myPortfolio_xpath=//*[@id='wrapper']/div[2]/ul/li[2]/a

#Input box
username_xpath=//*[@id='useremail']
password_xpath=//*[@id='userpass']
newPortfolioName_xpath=//*[@id='create']



#Buttons
emailsubmit_xpath= //*[@id='emailsubmit']
loginsubmit_xpath=//*[@id='loginsubmit']
createPortfolio_xpath=//*[@id='createPortfolio']
createPortfolioButton_xpath=//*[@id='createPortfolioButton']


#titles
homePagetitle=Rediff.com: Online Shopping, Rediffmail, Latest India News, Business, Bollywood, Sports, Stock, Live Cricket Score, Money, Movie Reviews



Result:
[TestNG] Running:
C:\Users\Venkatr.117\AppData\Local\Temp\testng-eclipse--382558699\testng-customsuite.xml

1
openBrowser--------Browser
Executing test on the browser - Mozilla
Starting function openBrowserMozilla
log4j:WARN No appenders could be found for logger (org.apache.http.client.protocol.RequestAddCookies).
log4j:WARN Please initialize the log4j system properly.
Ending function openBrowser with statusPASS
loginIfNotLoggedIn--------
Executing test on the browser - null
Enterign function loginIfNotLoggedIn
Starting function navigate
Ending function navigate with statusPASS
Starting function clickmoneyLink_xpath
Finding elementmoneyLink_xpath
Ending function click with statusPASS
Starting function clickmyPortfolio_xpath
Finding elementmyPortfolio_xpath
Ending function click with statusPASS
Starting function inputusername_xpath, lr.seleniumtest
Finding elementusername_xpath
Ending function input with status - PASS
Starting function clickemailsubmit_xpath
Finding elementemailsubmit_xpath
Ending function click with statusPASS
Starting function inputpassword_xpath, seleniumtest
Finding elementpassword_xpath
Ending function input with status - PASS
Starting function clickloginsubmit_xpath
Finding elementloginsubmit_xpath
Ending function click with statusPASS
Eixting function loginIfNotLogeedIn
clickAndWait----createPortfolio_xpath,newPortfolioName_xpath----
Executing test on the browser - null
Starting function clickAndWaitcreatePortfolio_xpath,newPortfolioName_xpath
Finding elementcreatePortfolio_xpath
Finding elementnewPortfolioName_xpath
clearTextField----newPortfolioName_xpath----
Executing test on the browser - null
Starting function clearTextFieldnewPortfolioName_xpath
Finding elementnewPortfolioName_xpath
Ending function clearTextField with status PASS
input----newPortfolioName_xpath----PortfolioName
Executing test on the browser - null
[color=#FF0000:2o5tclbr]Starting function inputnewPortfolioName_xpath, null[/color:2o5tclbr]
Finding elementnewPortfolioName_xpath
Ending function input with status - PASS
click----createPortfolioButton_xpath----
Executing test on the browser - null
Starting function clickcreatePortfolioButton_xpath
Finding elementcreatePortfolioButton_xpath
Ending function click with statusPASS
verifyPortfolio--------
Executing test on the browser - null
PASSED: CreatePortFolioTest({Case=CASE_OK, PortFolioName=MyPortfolioAA, Runmode=Y, Iteration=1, Browser=Mozilla})
PASSED: deletePortFolioTest
PASSED: renamePortFolioTest
SKIPPED: CreatePortFolioTest({Case=CASE_INVALID_NAME, PortFolioName=AddNewY1, Runmode=N, Iteration=2, Browser=Chrome})
org.testng.SkipException: Skipping the testCreatePortFolioTestas runmode was No
at com.qtpselenium.framework.util.Utility.validateTestExecution(Utility.java:115)
at com.qtpselenium.framework.suiteA.PortFolioTest.CreatePortFolioTest(PortFolioTest.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:639)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:816)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1124)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
at org.testng.TestRunner.privateRun(TestRunner.java:774)
at org.testng.TestRunner.run(TestRunner.java:624)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:359)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:354)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:312)
at org.testng.SuiteRunner.run(SuiteRunner.java:261)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1191)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1116)
at org.testng.TestNG.run(TestNG.java:1024)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:112)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:205)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:176)


===============================================
Default test
Tests run: 4, Failures: 0, Skips: 1
===============================================


===============================================
Default suite
Total tests run: 4, Failures: 0, Skips: 1
===============================================

[TestNG] Time taken by org.testng.reporters.XMLReporter@2db0f6b2: 167 ms
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 108 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter2@424c0bc4: 46 ms
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@2a3046da: 71 ms
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@2ff5659e: 1189 ms
[TestNG] Time taken by org.testng.reporters.jq.Main@57fa26b7: 292 ms

M
Replied on 25/02/2016

[quote:38wlcjgm]org.testng.SkipException: Skipping the testCreatePortFolioTestas runmode was No

[/quote:38wlcjgm]

fix xlsx files and "Yes" runmode.


M
Replied on 26/02/2016

hi Ashish, correct me if i'm wrong, runmode "N" was for executing the same iteration in chrome browser.
PASSED: CreatePortFolioTest({Case=CASE_OK, PortFolioName=MyPortfolioAA, Runmode=Y, Iteration=1, Browser=Mozilla})
PASSED: deletePortFolioTest
PASSED: renamePortFolioTest
SKIPPED: CreatePortFolioTest({Case=CASE_INVALID_NAME, PortFolioName=AddNewY1, Runmode=N, Iteration=2, Browser=Chrome})
org.testng.SkipException: Skipping the testCreatePortFolioTestas runmode was No


but here i'm facing the issue for the first iteration in Mozilla browser where the new portfolioname is passing in the xlsx is not entering into the text field. on browser it shows invalid portfolio name, below is the value i'm passing in xlsx file and the testcase is getting passed.
CreatePortFolioTest
Iteration Runmode Browser PortFolioName Case
1 Y Mozilla MyPortfolioxy CASE_OK

Result:
Starting function clearTextFieldnewPortfolioName_xpath
Finding elementnewPortfolioName_xpath
Ending function clearTextField with status PASS
input----newPortfolioName_xpath----PortfolioName
Starting function inputnewPortfolioName_xpath, null
Finding elementnewPortfolioName_xpath
Ending function input with status - PASS
click----createPortfolioButton_xpath----
Starting function clickcreatePortfolioButton_xpath
Finding elementcreatePortfolioButton_xpath
Ending function click with statusPASS


M
Replied on 26/02/2016

I have resolved the issue, there was a spelling error in my script in Constants file. now the new portfolio name got created successfully:-)