Exception on multi browser testing

Hi Lakshay,

I tried Multi Browser example but facing issue as below:

[TestNG] Running:


FAILED CONFIGURATION: @BeforeClass beforeTest


Parameter ‘browser’ is required by @Configuration on method beforeTest but has not been marked @Optional or defined

in C:\Users\IBM_ADMIN\AppData\Local\Temp\testng-eclipse–1034656778\testng-customsuite.xml

at org.testng.internal.Parameters.createParameters(Parameters.java:155)



Test Code




Train Asked on August 20, 2014 in Selenium WebDriver.
Add Comment
  • 3 Answer(s)
    Best answer


    Your code looks fine to me and the same code worked for me.

    I bet you must have right click your test case java or some test methods, and click run as testng.

    Pls try to right click your xml directly and select run as testng.

    You can run your test either:
    – Right clicking on your xml file and choosing Run As…->TestNG Suite
    1. Set your xml file in Project->Properties->TestNG->Template XML File
    2. Right click on your Java file and choosing Run As…->TestNG Test

    Please let me know if this resolves your issue.

    Lakshay Sharma

    Professor Answered on August 20, 2014.
    Add Comment

    Why not create a separate xml for this test and include all the testable classes in it. It is an easy way out and it will be just one time effort. Keep this xml alway separate from your other xmls so that you do not need to modify it. We can have multiple suites right?


    The other way around is using Data sheet and drive your test from it.

    Best Regards,

    Lakshay Sharma

    Professor Answered on August 20, 2014.
    Add Comment

    Hi Lakshay,

    Thanks for everything

    Hear you use only one class i.e <class name=”automationFramework.MultiBrowser” /> for testing in TestNG file for differnet browsers but, I want to run multiple class in different Browser please help me how Can I do it?


    Train Answered on August 20, 2014.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.