AssertionViolatedException

833 görüntüleme
İlk okunmamış mesaja atla

Mike Frank

okunmadı,
19 Eki 2016 14:27:0119.10.2016
alıcı seleniu...@googlegroups.com
Hi,

I'm going through the Selenium Webdriver with Java tutorial, and I ran the code below from the tutorial (which is toward the beginning of the tutorial --> http://www.seleniumhq.org/docs/03_webdriver.jsp), only to receive the exception

org.apache.bcel.verifier.exc.AssertionViolatedException.main(AssertionViolatedException.java:102)

Has anyone else encountered this issue? If so, how did you resolve it?

(Please provide steps to fix if you know the solution.)

BTW: I am using FF 49.0.1

Thanks,

Mike

#################################################################

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.ExpectedCondition;
import org.openqa.selenium.support.ui.WebDriverWait;
public class Selenium2Example {
 public static void main(String[] args) {
        // Create a new instance of the Firefox driver
        // Notice that the remainder of the code relies on the interface,
        // not the implementation.
        WebDriver driver = new FirefoxDriver();
        // And now use this to visit Google
        driver.get("http://www.google.com");
        // Alternatively the same thing can be done like this
        // driver.navigate().to("http://www.google.com");
        // Find the text input element by its name
        WebElement element = driver.findElement(By.name("q"));
        // Enter something to search for
        element.sendKeys("Cheese!");
        // Now submit the form. WebDriver will find the form for us from the element
        element.submit();
        // Check the title of the page
        System.out.println("Page title is: " + driver.getTitle());
       
        // Google's search is rendered dynamically with JavaScript.
        // Wait for the page to load, timeout after 10 seconds
        (new WebDriverWait(driver, 10)).until(new ExpectedCondition<Boolean>() {
            public Boolean apply(WebDriver d) {
                return d.getTitle().toLowerCase().startsWith("cheese!");
            }
        });
        // Should see: "cheese! - Google Search"
        System.out.println("Page title is: " + driver.getTitle());
       
        //Close the browser
        driver.quit();
    }
}

⇜Krishnan Mahadevan⇝

okunmadı,
20 Eki 2016 01:03:2920.10.2016
alıcı Selenium Users
Mike,

Selenium for sure will not raise this exception. Please see this SO Post : http://stackoverflow.com/a/9609186

There is something else in your project that is doing this.

Can you please shed more light around :

How are you structuring your project ?
How are you adding jars to your CLASSPATH ? [ via build tools such as Ant/Maven/Gradle ? ]



Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAG-WgUzS5nbrJ4W7HDPEDkQ3nWYFBf5-tbpmdsACk5Xn4B_1SQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Mike Frank

okunmadı,
20 Eki 2016 13:01:2220.10.2016
alıcı seleniu...@googlegroups.com
Hi Krishnan,

I am using Maven to build the project, and adding a Java file for my source.

The IDE is Eclipse for Windows 10.

Selenium is 3.0.

Which class path are you referring to? Environmental, or the one setup in Eclipse?

The only .jar files that I see in the project are jre1.8 .jar files. I don't see the Selenium .jar files.  Should I see them also?

Please provide guidance, or send me a link to a video that would provide guidance.

Thank you.

To post to this group, send email to seleniu...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.

⇜Krishnan Mahadevan⇝

okunmadı,
21 Eki 2016 01:17:2421.10.2016
alıcı Selenium Users
Mike,

Can you please upload your maven project to github so that maybe I can clone and then try running it to see what is going on ?

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

On Thu, Oct 20, 2016 at 10:28 PM, Mike Frank <myke...@gmail.com> wrote:
Hi Krishnan,

I am using Maven to build the project, and adding a Java file for my source.

The IDE is Eclipse for Windows 10.

Selenium is 3.0.

Which class path are you referring to? Environmental, or the one setup in Eclipse?

The only .jar files that I see in the project are jre1.8 .jar files. I don't see the Selenium .jar files.  Should I see them also?

Please provide guidance, or send me a link to a video that would provide guidance.

Thank you.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.

Mike Frank

okunmadı,
24 Eki 2016 10:37:5824.10.2016
alıcı seleniu...@googlegroups.com
Hi Krishnan,

I deleted the project, and I am starting all over to see if I can figure out why I am getting an error.

I'll let you know if I am able to fix the problem.

Thank you,

Mike

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.

Mike

okunmadı,
4 Kas 2016 16:24:044.11.2016
alıcı Selenium Users
Hi Krishnan,

Solved the problem.

Selenium 3.0 requires webdriver.gecko.driver for all browsers.  Once I downloaded and accessed it through my code, I was all set.  However, I also need the Selenium Standalone server for the Firefox driver whose .jar I had not included.

Mike


On Friday, October 21, 2016 at 1:17:24 AM UTC-4, Krishnan wrote:
Mike,

Can you please upload your maven project to github so that maybe I can clone and then try running it to see what is going on ?

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

On Thu, Oct 20, 2016 at 10:28 PM, Mike Frank <myke...@gmail.com> wrote:
Hi Krishnan,

I am using Maven to build the project, and adding a Java file for my source.

The IDE is Eclipse for Windows 10.

Selenium is 3.0.

Which class path are you referring to? Environmental, or the one setup in Eclipse?

The only .jar files that I see in the project are jre1.8 .jar files. I don't see the Selenium .jar files.  Should I see them also?

Please provide guidance, or send me a link to a video that would provide guidance.

Thank you.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.

To post to this group, send email to seleniu...@googlegroups.com.
Tümünü yanıtla
Yazarı yanıtla
Yönlendir
0 yeni ileti