0
votes

I created a java project in eclipse using Selenium jar files . While running with JUnit test i am getting the Java Exception error :

package com.example.tests;

import com.thoughtworks.selenium.*;

import java.util.ArrayList; import java.util.HashMap; import com.infy.csvUtil.CSVFileReader;

public class Creation extends SeleneseTestCase { public void setUp() throws Exception { setUp("http://14.126.220.15:84333/", "*firefox"); }

public void Creationv2() throws Exception {

    try {
        selenium.open("CCC/CEP?REQUEST=SIGNONREQ");
    } catch (Exception e) {
        e.printStackTrace();
    }
    selenium.selectWindow(null);
    assertEquals("Selected panel window", selenium.getTitle());
    selenium.type("SignonUserName", "sssss");
    selenium.type("SignonPassword", "fewere");
    selenium.click("button1");
    if (selenium.isAlertPresent()) {
        selenium.getAlert();
    }

I am getting the following error while running:

**Java.lang.Assertionexception:Expected "Selected panel window" but saw ""instead.

1

1 Answers

0
votes

Assertion for the following statement failed.

 assertEquals("Selected panel window", selenium.getTitle());

Try to print the title using the following statement and confirm whether it is matching with the expected title (i.e., "Selected panel window")

System.out.println("Title -> "+selenium.getTitle());