Rediff Hybrid: Module 24 part 18: LoginTest--> : Appkeyword-> OBJECT NOT FOUND | Selenium Forum
K
Kam Posted on 29/07/2019

I am able to run HybridFrame work sucesfully, but have error while running HybridRediff Frame work.

I copy paste and import files for app key words , but logintest is NOT able to click :MONEY Link

I use same properties by using driver driver.findElement and all links are working fine. Issue is in getObject("money_xpath").click();

 

Cannot find OBJECT

 

While de bugging I also got “ Source NOT found” . I am using same jars and files as HYBRID Frame work. Successfully run TESTNG with two suite , NO issue. Same Appkeyword files is paste

 

 

                                                          Login

      public void login ()

      {

            System.out.println("Validate Login Test in APP Key WORDS for REDIFF");

            test.log(Status.INFO,"Validate Login Test in APP Key WORDS for REDIFF ");

           

      //    WebDriverWait wait = new WebDriverWait(driver, 10);

            //wait.until(ExpectedConditions.visibilityOf(getObject("money_xpath")));

           

      //    System.out.println("Validate Login Test in APP Key WORDS for REDIFF"+isElementPresent("money_xpath"));

 

      //    getObject("money_xpath").click();

            //Moneysign-in

            getObject("signin_xpath").click();

            //Moneylogin emai id

            getObject("username_id").sendKeys(data.get("userName"));

            //email submit

            getObject("emailsubmit_id").click();

           

            WebDriverWait wait = new WebDriverWait(driver, 20);

            wait.until(ExpectedConditions.visibilityOf(getObject("password_id")));

            //Money password

            getObject("password_xpath").sendKeys(data.get("password"));

            //#continue after Money password

            getObject("continue_id").click();

 

ENVOIRENMEnt file

#Money-Menu

 

money_xpath=//div[@class='logobar']/div/div[2]/a[2]

 

#Moneysign-in

signin_xpath= //*[@id="signin_info"]/a[1]

 

#Moneylogin emai id

username_id= useremail

 

#Money email submit

emailsubmit_id =emailsubmit

 

#Money password

#password_id= userpass

password_xpath =//div[@class='login-wrapper']/div[3]/input[@id='userpass']

#continue after Money password

continue_id=loginsubmit

 

 

 

=====================ERROR =============================================

Navigating to website    http:in.rediff.com

Validate Login Test in APP Key WORDS for REDIFF

FAILED: loginTest({ExpectedResult=LoginSuccesses, password=Selenium542, Runmode=Y, userName=Selenium542, Browser=Chrome})

java.lang.reflect.InvocationTargetException

      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 com.ktest.rediff.hybrid.driver.DriverScript.executeKeywords(DriverScript.java:89)

      at com.ktest.rediff.Hybrid.testCases.portfoliosuite.LoginTest.loginTest(LoginTest.java:40)

      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:124)

      at org.testng.internal.Invoker.invokeMethod(Invoker.java:583)

      at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:719)

      at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:989)

      at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)

      at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)

      at org.testng.TestRunner.privateRun(TestRunner.java:648)

      at org.testng.TestRunner.run(TestRunner.java:505)

      at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)

      at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)

      at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)

      at org.testng.SuiteRunner.run(SuiteRunner.java:364)

      at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)

      at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)

      at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)

      at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)

      at org.testng.TestNG.runSuites(TestNG.java:1049)

      at org.testng.TestNG.run(TestNG.java:1017)

      at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:114)

      at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)

      at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)

Caused by: java.lang.AssertionError: The following asserts failed:

      Object NOT Found

      at org.testng.asserts.SoftAssert.assertAll(SoftAssert.java:43)

      at com.ktest.rediff.hybrid.keywords.GenericKeywords.reportFailure(GenericKeywords.java:285)

      at com.ktest.rediff.hybrid.keywords.GenericKeywords.getObject(GenericKeywords.java:242)

      at com.ktest.rediff.hybrid.keywords.AppKeywords.login(AppKeywords.java:27)

      ... 31 more

 

 

 

 

 

POI :

dependency>

        <groupId>org.apache.poi</groupId>

        <artifactId>poi-ooxml</artifactId>

        <version>3.13</version>

    </dependency>

 

       <dependency>

        <groupId>org.apache.poi</groupId>

        <artifactId>poi</artifactId>

        <version>3.13</version>

    </dependency>

 

 

 

 


A
Ashish Thakur Replied on 29/07/2019

Did you try debugging the code?

Please check DriverScript.java line number 89 and LoginTest.java line number 40 for the possible error.

Additionally use poi 3.6


K
Kam Replied on 29/07/2019

 

 

Please check DriverScript.java line number 89 and LoginTest.java line number 40 for the possible error.

has following error. I verified tr.jar is included and is also has in destination folder

 

 

Responsive image


K
Kam Replied on 29/07/2019

I copy paste :

Please check DriverScript.java line number 89 and LoginTest.java line number 40 for the possible error.

both files from HybridFrame work. both filess have no issue and all test cases are running fine in Hybrid frame work, but have error in Hybrid.rediff

 


A
Ashish Thakur Replied on 31/07/2019

Source not found the screen comes up when you're debugging the code and the control goes to a jar file.

Please use F6 key instead and when the execution stops, you get the line where the error is.


K
Kam Replied on 12/08/2019

I resolved: issue was "object key" has some places in Capital while other in small