Hi,

I have automating the Site in Selenium-RC in Java.

*My Configuration –*

1) Selenium RC - selenium-server-standalone-2.25.0.jar

2) Eclipse – Indigo Latest.

3) Testing-6.8.jar

It displays error for *verifyText()* – as *“The Method verifyText(boolean)
is undefined.”* Why it is so?



*My Code –*

import com.thoughtworks.selenium.*;

import org.testng.Assert;

import org.testng.annotations.*;

import static org.testng.Assert.*;

import java.util.regex.Pattern;


public class FLOW //extends SeleneseTestNgHelper

{

private Selenium selenium;

@BeforeClass

public void setUp() throws Exception {

selenium = new DefaultSelenium("localhost", 4444, "*firefox",
"http://oswego.biz/");

selenium.start();

}

@Test

public void testTNF_Non_Admin_TC001() throws Exception

{

// Login with valid credential and see the default page should opens on the
screen.

try

{

selenium.open("/Digitalworkbook_staging/default.aspx?alias=tnf");

}

catch(Exception e)

{

selenium.waitForPageToLoad("60000");

}

selenium.type("id=txtUserName", "bprice");

selenium.type("id=txtPassword", "1234");

selenium.click("link=Login");

selenium.waitForPageToLoad("60000");

selenium.click("css=#ContentPlaceHolder1_viewAllPanel > table > tbody > tr
td");

//verifyTrue(selenium.isTextPresent("My Recent Documents"));

//verifyTrue(selenium.isTextPresent("My Recent Documents"));

assertTrue(selenium.isTextPresent("My Recent Documents"));


selenium.click("//td[@id='adminContentHolder']/table/tbody/tr/td[3]/table/tbody/tr[2]/td/table/tbody/tr/td");

//verifyTrue(selenium.isTextPresent("My Documents"));

assertTrue(selenium.isTextPresent("My Documents"));

selenium.click("css=td.b2bTopNav");

selenium.click("css=td.homeWelcomeLink");

verifyTrue(selenium.isTextPresent("Welcome bprice"));

//assertTrue(selenium.isTextPresent("Welcome bprice"));

}


@AfterClass

public void tearDown() throws Exception {

selenium.stop();

}

}

2) When I export code from Selenium IDE as “Java/TestNG/Remote Control”
there is @Before and @After method is missing.



Is I am doing any wrong thing?



Waiting for Valuable reply!


Thanks in Advance.


Regards,

Shailesh Jagtap.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/oVI4310wyokJ.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Prakash Jayakumar at Dec 5, 2012 at 7:28 am
    Woah !!!! TestNG tests doesn't have @Before or @After methods o.O

    I exported it as JUnit4/Remote Control and it gave me I exported it as
    JUnit4/Remote Control and it gave me @Before or @After methods !!

    Is this the actual behavior or some kinda bug. Please some selenium
    developer reply to this post.. please

    Shailesh buddy, if you get any breakthrough on this please do update here.

    Cheers !!
    On Monday, December 3, 2012 4:13:56 PM UTC+5:30, Shailesh wrote:

    Hi,

    I have automating the Site in Selenium-RC in Java.

    *My Configuration –*

    1) Selenium RC - selenium-server-standalone-2.25.0.jar

    2) Eclipse – Indigo Latest.

    3) Testing-6.8.jar

    It displays error for *verifyText()* – as *“The Method
    verifyText(boolean) is undefined.”* Why it is so?



    *My Code –*

    import com.thoughtworks.selenium.*;

    import org.testng.Assert;

    import org.testng.annotations.*;

    import static org.testng.Assert.*;

    import java.util.regex.Pattern;


    public class FLOW //extends SeleneseTestNgHelper

    {

    private Selenium selenium;

    @BeforeClass

    public void setUp() throws Exception {

    selenium = new DefaultSelenium("localhost", 4444, "*firefox", "
    http://oswego.biz/");

    selenium.start();

    }

    @Test

    public void testTNF_Non_Admin_TC001() throws Exception

    {

    // Login with valid credential and see the default page should opens on
    the screen.

    try

    {

    selenium.open("/Digitalworkbook_staging/default.aspx?alias=tnf");

    }

    catch(Exception e)

    {

    selenium.waitForPageToLoad("60000");

    }

    selenium.type("id=txtUserName", "bprice");

    selenium.type("id=txtPassword", "1234");

    selenium.click("link=Login");

    selenium.waitForPageToLoad("60000");

    selenium.click("css=#ContentPlaceHolder1_viewAllPanel > table > tbody > tr
    td");

    //verifyTrue(selenium.isTextPresent("My Recent Documents"));

    //verifyTrue(selenium.isTextPresent("My Recent Documents"));

    assertTrue(selenium.isTextPresent("My Recent Documents"));


    selenium.click("//td[@id='adminContentHolder']/table/tbody/tr/td[3]/table/tbody/tr[2]/td/table/tbody/tr/td");

    //verifyTrue(selenium.isTextPresent("My Documents"));

    assertTrue(selenium.isTextPresent("My Documents"));

    selenium.click("css=td.b2bTopNav");

    selenium.click("css=td.homeWelcomeLink");

    verifyTrue(selenium.isTextPresent("Welcome bprice"));

    //assertTrue(selenium.isTextPresent("Welcome bprice"));

    }


    @AfterClass

    public void tearDown() throws Exception {

    selenium.stop();

    }

    }

    2) When I export code from Selenium IDE as “Java/TestNG/Remote Control”
    there is @Before and @After method is missing.



    Is I am doing any wrong thing?



    Waiting for Valuable reply!


    Thanks in Advance.


    Regards,

    Shailesh Jagtap.
    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/3hDHXXfFa-sJ.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Mark Collin at Dec 5, 2012 at 10:33 pm
    *sigh* yes it does, many in fact:



    http://testng.org/doc/documentation-main.html#annotations



    From: selenium-users@googlegroups.com
    On Behalf Of Prakash Jayakumar
    Sent: 05 December 2012 07:28
    To: selenium-users@googlegroups.com
    Subject: [selenium-users] Re: Why TestNG does not support the verifyText()?



    Woah !!!! TestNG tests doesn't have @Before or @After methods o.O



    I exported it as JUnit4/Remote Control and it gave me I exported it as
    JUnit4/Remote Control and it gave me @Before or @After methods !!



    Is this the actual behavior or some kinda bug. Please some selenium
    developer reply to this post.. please



    Shailesh buddy, if you get any breakthrough on this please do update here.



    Cheers !!

    On Monday, December 3, 2012 4:13:56 PM UTC+5:30, Shailesh wrote:

    Hi,

    I have automating the Site in Selenium-RC in Java.

    My Configuration -

    1) Selenium RC - selenium-server-standalone-2.25.0.jar

    2) Eclipse - Indigo Latest.

    3) Testing-6.8.jar

    It displays error for verifyText() - as "The Method verifyText(boolean) is
    undefined." Why it is so?



    My Code -

    import com.thoughtworks.selenium.*;

    import org.testng.Assert;

    import org.testng.annotations.*;

    import static org.testng.Assert.*;

    import java.util.regex.Pattern;



    public class FLOW //extends SeleneseTestNgHelper

    {

    private Selenium selenium;

    @BeforeClass

    public void setUp() throws Exception {

    selenium = new DefaultSelenium("localhost", 4444,
    "*firefox", "http://oswego.biz/");

    selenium.start();

    }

    @Test

    public void testTNF_Non_Admin_TC001() throws Exception

    {

    // Login with valid credential and see the default
    page should opens on the screen.

    try

    {


    selenium.open("/Digitalworkbook_staging/default.aspx?alias=tnf");

    }

    catch(Exception e)

    {

    selenium.waitForPageToLoad("60000");

    }

    selenium.type("id=txtUserName", "bprice");

    selenium.type("id=txtPassword", "1234");

    selenium.click("link=Login");

    selenium.waitForPageToLoad("60000");


    selenium.click("css=#ContentPlaceHolder1_viewAllPanel > table > tbody > tr >
    td");





    //verifyTrue(selenium.isTextPresent("My Recent
    Documents"));

    //verifyTrue(selenium.isTextPresent("My Recent
    Documents"));

    assertTrue(selenium.isTextPresent("My Recent
    Documents"));




    selenium.click("//td[@id='adminContentHolder']/table/tbody/tr/td[3]/table/tb
    ody/tr[2]/td/table/tbody/tr/td");

    //verifyTrue(selenium.isTextPresent("My
    Documents"));

    assertTrue(selenium.isTextPresent("My Documents"));

    selenium.click("css=td.b2bTopNav");

    selenium.click("css=td.homeWelcomeLink");

    verifyTrue(selenium.isTextPresent("Welcome
    bprice"));

    //assertTrue(selenium.isTextPresent("Welcome
    bprice"));

    }



    @AfterClass

    public void tearDown() throws Exception {

    selenium.stop();

    }

    }



    2) When I export code from Selenium IDE as "Java/TestNG/Remote Control"
    there is @Before and @After method is missing.



    Is I am doing any wrong thing?



    Waiting for Valuable reply!



    Thanks in Advance.



    Regards,

    Shailesh Jagtap.

    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/3hDHXXfFa-sJ.
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Prakash Jayakumar at Dec 6, 2012 at 4:21 am
    Hey Mark,

    Yup, i know that TestNG does have many annotations. The problem was that
    when it is exported from the IDE, it doesn't provide any other method with
    annotations such as @BeforeTest or @AfterTest. All it gives is a @Test
    method !!!

    Thanks for your reply with *sigh* though :D

    Cheers !!
    On Thursday, December 6, 2012 4:03:11 AM UTC+5:30, Mark Collin wrote:

    **sigh** yes it does, many in fact:



    http://testng.org/doc/documentation-main.html#annotations



    *From:* seleniu...@googlegroups.com <javascript:> [mailto:
    seleniu...@googlegroups.com <javascript:>] *On Behalf Of *Prakash
    Jayakumar
    *Sent:* 05 December 2012 07:28
    *To:* seleniu...@googlegroups.com <javascript:>
    *Subject:* [selenium-users] Re: Why TestNG does not support the
    verifyText()?



    Woah !!!! TestNG tests doesn't have @Before or @After methods o.O



    I exported it as JUnit4/Remote Control and it gave me I exported it as
    JUnit4/Remote Control and it gave me @Before or @After methods !!



    Is this the actual behavior or some kinda bug. Please some selenium
    developer reply to this post.. please



    Shailesh buddy, if you get any breakthrough on this please do update here.



    Cheers !!

    On Monday, December 3, 2012 4:13:56 PM UTC+5:30, Shailesh wrote:

    Hi,

    I have automating the Site in Selenium-RC in Java.

    *My Configuration –*

    1) Selenium RC - selenium-server-standalone-2.25.0.jar

    2) Eclipse – Indigo Latest.

    3) Testing-6.8.jar

    It displays error for *verifyText()* – as *“The Method
    verifyText(boolean) is undefined.”* Why it is so?



    *My Code –*

    import com.thoughtworks.selenium.*;

    import org.testng.Assert;

    import org.testng.annotations.*;

    import static org.testng.Assert.*;

    import java.util.regex.Pattern;



    public class FLOW //extends SeleneseTestNgHelper

    {

    private Selenium selenium;

    @BeforeClass

    public void setUp() throws Exception {

    selenium = new DefaultSelenium("localhost", 4444,
    "*firefox", "http://oswego.biz/");

    selenium.start();

    }

    @Test

    public void testTNF_Non_Admin_TC001() throws Exception

    {

    // Login with valid credential and see the default
    page should opens on the screen.

    try

    {


    selenium.open("/Digitalworkbook_staging/default.aspx?alias=tnf");

    }

    catch(Exception e)

    {

    selenium.waitForPageToLoad("60000");

    }

    selenium.type("id=txtUserName", "bprice");

    selenium.type("id=txtPassword", "1234");

    selenium.click("link=Login");

    selenium.waitForPageToLoad("60000");


    selenium.click("css=#ContentPlaceHolder1_viewAllPanel > table > tbody > tr
    td");




    //verifyTrue(selenium.isTextPresent("My Recent
    Documents"));

    //verifyTrue(selenium.isTextPresent("My Recent
    Documents"));

    assertTrue(selenium.isTextPresent("My Recent
    Documents"));




    selenium.click("//td[@id='adminContentHolder']/table/tbody/tr/td[3]/table/tbody/tr[2]/td/table/tbody/tr/td");

    //verifyTrue(selenium.isTextPresent("My
    Documents"));

    assertTrue(selenium.isTextPresent("My Documents"));

    selenium.click("css=td.b2bTopNav");

    selenium.click("css=td.homeWelcomeLink");

    verifyTrue(selenium.isTextPresent("Welcome
    bprice"));

    //assertTrue(selenium.isTextPresent("Welcome
    bprice"));

    }



    @AfterClass

    public void tearDown() throws Exception {

    selenium.stop();

    }

    }



    2) When I export code from Selenium IDE as “Java/TestNG/Remote Control”
    there is @Before and @After method is missing.



    Is I am doing any wrong thing?



    Waiting for Valuable reply!



    Thanks in Advance.



    Regards,

    Shailesh Jagtap.

    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/3hDHXXfFa-sJ.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/IXcz_0Nb0AIJ.
    For more options, visit https://groups.google.com/groups/opt_out.
  • ALISTER ERNEST at Dec 6, 2012 at 4:29 am
    Prakash - I believe that "sigh" was because you expected a TestNG
    annotation while exporting in the Junit format. It has to be manually
    changed mate!!!!
    On Wednesday, December 5, 2012 9:21:13 PM UTC-7, Prakash Jayakumar wrote:

    Hey Mark,

    Yup, i know that TestNG does have many annotations. The problem was that
    when it is exported from the IDE, it doesn't provide any other method with
    annotations such as @BeforeTest or @AfterTest. All it gives is a @Test
    method !!!

    Thanks for your reply with *sigh* though :D

    Cheers !!
    On Thursday, December 6, 2012 4:03:11 AM UTC+5:30, Mark Collin wrote:

    **sigh** yes it does, many in fact:



    http://testng.org/doc/documentation-main.html#annotations



    *From:* seleniu...@googlegroups.com
    *On Behalf Of *Prakash Jayakumar
    *Sent:* 05 December 2012 07:28
    *To:* seleniu...@googlegroups.com
    *Subject:* [selenium-users] Re: Why TestNG does not support the
    verifyText()?



    Woah !!!! TestNG tests doesn't have @Before or @After methods o.O



    I exported it as JUnit4/Remote Control and it gave me I exported it as
    JUnit4/Remote Control and it gave me @Before or @After methods !!



    Is this the actual behavior or some kinda bug. Please some selenium
    developer reply to this post.. please



    Shailesh buddy, if you get any breakthrough on this please do update here.



    Cheers !!

    On Monday, December 3, 2012 4:13:56 PM UTC+5:30, Shailesh wrote:

    Hi,

    I have automating the Site in Selenium-RC in Java.

    *My Configuration –*

    1) Selenium RC - selenium-server-standalone-2.25.0.jar

    2) Eclipse – Indigo Latest.

    3) Testing-6.8.jar

    It displays error for *verifyText()* – as *“The Method
    verifyText(boolean) is undefined.”* Why it is so?



    *My Code –*

    import com.thoughtworks.selenium.*;

    import org.testng.Assert;

    import org.testng.annotations.*;

    import static org.testng.Assert.*;

    import java.util.regex.Pattern;



    public class FLOW //extends SeleneseTestNgHelper

    {

    private Selenium selenium;

    @BeforeClass

    public void setUp() throws Exception {

    selenium = new DefaultSelenium("localhost", 4444,
    "*firefox", "http://oswego.biz/");

    selenium.start();

    }

    @Test

    public void testTNF_Non_Admin_TC001() throws Exception

    {

    // Login with valid credential and see the
    default page should opens on the screen.

    try

    {


    selenium.open("/Digitalworkbook_staging/default.aspx?alias=tnf");

    }

    catch(Exception e)

    {

    selenium.waitForPageToLoad("60000");

    }

    selenium.type("id=txtUserName", "bprice");

    selenium.type("id=txtPassword", "1234");

    selenium.click("link=Login");

    selenium.waitForPageToLoad("60000");


    selenium.click("css=#ContentPlaceHolder1_viewAllPanel > table > tbody > tr
    td");




    //verifyTrue(selenium.isTextPresent("My Recent
    Documents"));

    //verifyTrue(selenium.isTextPresent("My Recent
    Documents"));

    assertTrue(selenium.isTextPresent("My Recent
    Documents"));




    selenium.click("//td[@id='adminContentHolder']/table/tbody/tr/td[3]/table/tbody/tr[2]/td/table/tbody/tr/td");

    //verifyTrue(selenium.isTextPresent("My
    Documents"));

    assertTrue(selenium.isTextPresent("My
    Documents"));

    selenium.click("css=td.b2bTopNav");

    selenium.click("css=td.homeWelcomeLink");

    verifyTrue(selenium.isTextPresent("Welcome
    bprice"));

    //assertTrue(selenium.isTextPresent("Welcome
    bprice"));

    }



    @AfterClass

    public void tearDown() throws Exception {

    selenium.stop();

    }

    }



    2) When I export code from Selenium IDE as “Java/TestNG/Remote Control”
    there is @Before and @After method is missing.



    Is I am doing any wrong thing?



    Waiting for Valuable reply!



    Thanks in Advance.



    Regards,

    Shailesh Jagtap.

    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/3hDHXXfFa-sJ.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/lxdvk4IzZooJ.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Prakash Jayakumar at Dec 6, 2012 at 4:41 am
    #Shailesh - :) :) Even i wonder the same !!

    #Alister - Nope i didn't expect that broh !! i meant that I exported it as
    a TestNG and i couldn't see any @Before/@BeforeClass and @After/AfterClass
    method(just like Shailesh has mentioned). But when i exported it as JUnit,
    i do see @Before/@BeforeClass and @After/AfterClass method along with @Test.

    Maybe i didn't put the words right :(

    But why is that so? Why we have to manually add @Before/@BeforeClass to
    create setting up and starting of Selenium server and to stop it in @After/AfterClass
    method ?? This was my doubt too..

    #Mark - No offense :)
    On Thursday, December 6, 2012 9:58:58 AM UTC+5:30, ALISTER ERNEST wrote:

    Prakash - I believe that "sigh" was because you expected a TestNG
    annotation while exporting in the Junit format. It has to be manually
    changed mate!!!!
    On Wednesday, December 5, 2012 9:21:13 PM UTC-7, Prakash Jayakumar wrote:

    Hey Mark,

    Yup, i know that TestNG does have many annotations. The problem was that
    when it is exported from the IDE, it doesn't provide any other method with
    annotations such as @BeforeTest or @AfterTest. All it gives is a @Test
    method !!!

    Thanks for your reply with *sigh* though :D

    Cheers !!
    On Thursday, December 6, 2012 4:03:11 AM UTC+5:30, Mark Collin wrote:

    **sigh** yes it does, many in fact:



    http://testng.org/doc/documentation-main.html#annotations



    *From:* seleniu...@googlegroups.com
    *On Behalf Of *Prakash Jayakumar
    *Sent:* 05 December 2012 07:28
    *To:* seleniu...@googlegroups.com
    *Subject:* [selenium-users] Re: Why TestNG does not support the
    verifyText()?



    Woah !!!! TestNG tests doesn't have @Before or @After methods o.O



    I exported it as JUnit4/Remote Control and it gave me I exported it as
    JUnit4/Remote Control and it gave me @Before or @After methods !!



    Is this the actual behavior or some kinda bug. Please some selenium
    developer reply to this post.. please



    Shailesh buddy, if you get any breakthrough on this please do update
    here.



    Cheers !!

    On Monday, December 3, 2012 4:13:56 PM UTC+5:30, Shailesh wrote:

    Hi,

    I have automating the Site in Selenium-RC in Java.

    *My Configuration –*

    1) Selenium RC - selenium-server-standalone-2.25.0.jar

    2) Eclipse – Indigo Latest.

    3) Testing-6.8.jar

    It displays error for *verifyText()* – as *“The Method
    verifyText(boolean) is undefined.”* Why it is so?



    *My Code –*

    import com.thoughtworks.selenium.*;

    import org.testng.Assert;

    import org.testng.annotations.*;

    import static org.testng.Assert.*;

    import java.util.regex.Pattern;



    public class FLOW //extends SeleneseTestNgHelper

    {

    private Selenium selenium;

    @BeforeClass

    public void setUp() throws Exception {

    selenium = new DefaultSelenium("localhost",
    4444, "*firefox", "http://oswego.biz/");

    selenium.start();

    }

    @Test

    public void testTNF_Non_Admin_TC001() throws Exception

    {

    // Login with valid credential and see the
    default page should opens on the screen.

    try

    {


    selenium.open("/Digitalworkbook_staging/default.aspx?alias=tnf");

    }

    catch(Exception e)

    {

    selenium.waitForPageToLoad("60000");

    }

    selenium.type("id=txtUserName", "bprice");

    selenium.type("id=txtPassword", "1234");

    selenium.click("link=Login");

    selenium.waitForPageToLoad("60000");


    selenium.click("css=#ContentPlaceHolder1_viewAllPanel > table > tbody > tr
    td");




    //verifyTrue(selenium.isTextPresent("My Recent
    Documents"));

    //verifyTrue(selenium.isTextPresent("My Recent
    Documents"));

    assertTrue(selenium.isTextPresent("My Recent
    Documents"));




    selenium.click("//td[@id='adminContentHolder']/table/tbody/tr/td[3]/table/tbody/tr[2]/td/table/tbody/tr/td");

    //verifyTrue(selenium.isTextPresent("My
    Documents"));

    assertTrue(selenium.isTextPresent("My
    Documents"));

    selenium.click("css=td.b2bTopNav");

    selenium.click("css=td.homeWelcomeLink");

    verifyTrue(selenium.isTextPresent("Welcome
    bprice"));

    //assertTrue(selenium.isTextPresent("Welcome
    bprice"));

    }



    @AfterClass

    public void tearDown() throws Exception {

    selenium.stop();

    }

    }



    2) When I export code from Selenium IDE as “Java/TestNG/Remote Control”
    there is @Before and @After method is missing.



    Is I am doing any wrong thing?



    Waiting for Valuable reply!



    Thanks in Advance.



    Regards,

    Shailesh Jagtap.

    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/3hDHXXfFa-sJ.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/jwbWlWhkfEsJ.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Shailesh at Dec 6, 2012 at 5:47 am
    Hi ALISTER ERNEST,

    There is NO command as verificationError() in TestNG.

    I have imported below package
    import com.thoughtworks.selenium.*;
    import org.junit.After;
    import org.junit.Before;
    import org.junit.Test;
    import java.util.regex.Pattern;

    And this Too

    import org.apache.bcel.verifier.VerificationResult;
    import org.apache.bcel.verifier.exc.VerificationException;
    import org.testng.Assert;
    import org.testng.annotations.*;
    import static org.testng.Assert.*;

    to check whether this is present in JUnit4. But same result.

    Is there any jar file need to add to project as like TestNG for JUnit?

    Thanks,
    Shailesh.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/bBz8O0u7wscJ.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Krishnan Mahadevan at Dec 6, 2012 at 6:28 am
    Shailesh,
    Most of the things that you are referring to as missing are part
    of SeleneseTestNgHelper.

    Have your test class extend this class and you should start seeing them.

    With respect to the @Before configuration methods missing, yes this looks
    like a bug in Selenium IDE.

    I gave it a try using Selenium IDE 1.9.0
    and exported my code as Java/TestNG/Remote Control [Wonder why we dont have
    a WebDriver/WebDriverBackedSelenium flavor here]

    I only see the @Test annotated method when the test case is being exported
    whereas for the JUnit formats, the configuration methods are there.

    Thanks & Regards
    Krishnan Mahadevan

    "All the desirable things in life are either illegal, expensive, fattening
    or in love with someone else!"



    On Thu, Dec 6, 2012 at 11:17 AM, Shailesh
    wrote:
    Hi ALISTER ERNEST,

    There is NO command as verificationError() in TestNG.

    I have imported below package
    import com.thoughtworks.selenium.*;
    import org.junit.After;
    import org.junit.Before;
    import org.junit.Test;
    import java.util.regex.Pattern;

    And this Too

    import org.apache.bcel.verifier.VerificationResult;
    import org.apache.bcel.verifier.exc.VerificationException;
    import org.testng.Assert;
    import org.testng.annotations.*;
    import static org.testng.Assert.*;

    to check whether this is present in JUnit4. But same result.

    Is there any jar file need to add to project as like TestNG for JUnit?

    Thanks,
    Shailesh.

    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/bBz8O0u7wscJ.

    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Shailesh at Dec 6, 2012 at 8:47 am
    Hi Krishnan,

    I tried to extend my class with SeleneseTestNgHelper. But in that case IE
    browser gets displayed and nothing gets worked/happen.

    I do not know what is wrong into that. Please provide your opinion.

    For my Code, refer first Post.

    Thanks,
    Shailesh.
    On Thursday, December 6, 2012 11:58:37 AM UTC+5:30, Krishnan wrote:

    Shailesh,
    Most of the things that you are referring to as missing are part
    of SeleneseTestNgHelper.

    Have your test class extend this class and you should start seeing them.

    With respect to the @Before configuration methods missing, yes this looks
    like a bug in Selenium IDE.

    I gave it a try using Selenium IDE 1.9.0
    and exported my code as Java/TestNG/Remote Control [Wonder why we dont
    have a WebDriver/WebDriverBackedSelenium flavor here]

    I only see the @Test annotated method when the test case is being exported
    whereas for the JUnit formats, the configuration methods are there.

    Thanks & Regards
    Krishnan Mahadevan

    "All the desirable things in life are either illegal, expensive, fattening
    or in love with someone else!"



    On Thu, Dec 6, 2012 at 11:17 AM, Shailesh <shailes...@encodexindia.com<javascript:>
    wrote:
    Hi ALISTER ERNEST,

    There is NO command as verificationError() in TestNG.

    I have imported below package
    import com.thoughtworks.selenium.*;
    import org.junit.After;
    import org.junit.Before;
    import org.junit.Test;
    import java.util.regex.Pattern;

    And this Too

    import org.apache.bcel.verifier.VerificationResult;
    import org.apache.bcel.verifier.exc.VerificationException;
    import org.testng.Assert;
    import org.testng.annotations.*;
    import static org.testng.Assert.*;

    to check whether this is present in JUnit4. But same result.

    Is there any jar file need to add to project as like TestNG for JUnit?

    Thanks,
    Shailesh.

    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To unsubscribe from this group, send email to
    selenium-user...@googlegroups.com <javascript:>.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/bBz8O0u7wscJ.

    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/yIB25yK1-noJ.
    For more options, visit https://groups.google.com/groups/opt_out.
  • ALISTER ERNEST at Dec 6, 2012 at 6:30 am
    Shailesh -

    "verificationError()" is a user defined method to pass the initial
    "verificationErrorString" defined at the start of the code.

    And yes, you would need to include the testng.jar in your build path.
    On Wednesday, December 5, 2012 10:47:46 PM UTC-7, Shailesh wrote:

    Hi ALISTER ERNEST,

    There is NO command as verificationError() in TestNG.

    I have imported below package
    import com.thoughtworks.selenium.*;
    import org.junit.After;
    import org.junit.Before;
    import org.junit.Test;
    import java.util.regex.Pattern;

    And this Too

    import org.apache.bcel.verifier.VerificationResult;
    import org.apache.bcel.verifier.exc.VerificationException;
    import org.testng.Assert;
    import org.testng.annotations.*;
    import static org.testng.Assert.*;

    to check whether this is present in JUnit4. But same result.

    Is there any jar file need to add to project as like TestNG for JUnit?

    Thanks,
    Shailesh.
    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/_zS-7XlQoCgJ.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Krishnan Mahadevan at Dec 6, 2012 at 6:47 am
    Alister,
    I beg to differ. There are a lot of verify() methods that are included as
    part of selenium-java library itself [ That is
    where com.thoughtworks.selenium.SeleneseTestNgHelper comes in as well]

    Thanks & Regards
    Krishnan Mahadevan

    "All the desirable things in life are either illegal, expensive, fattening
    or in love with someone else!"


    On Thu, Dec 6, 2012 at 12:00 PM, ALISTER ERNEST wrote:

    Shailesh -

    "verificationError()" is a user defined method to pass the initial
    "verificationErrorString" defined at the start of the code.

    And yes, you would need to include the testng.jar in your build path.
    On Wednesday, December 5, 2012 10:47:46 PM UTC-7, Shailesh wrote:

    Hi ALISTER ERNEST,

    There is NO command as verificationError() in TestNG.

    I have imported below package
    import com.thoughtworks.selenium.*;
    import org.junit.After;
    import org.junit.Before;
    import org.junit.Test;
    import java.util.regex.Pattern;

    And this Too

    import org.apache.bcel.verifier.**VerificationResult;
    import org.apache.bcel.verifier.exc.**VerificationException;
    import org.testng.Assert;
    import org.testng.annotations.*;
    import static org.testng.Assert.*;

    to check whether this is present in JUnit4. But same result.

    Is there any jar file need to add to project as like TestNG for JUnit?

    Thanks,
    Shailesh.
    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/selenium-users/-/_zS-7XlQoCgJ.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Shailesh at Dec 6, 2012 at 4:26 am
    Thanks for Reply to Prakash Jayakumar , ALISTER ERNEST and Mark Collin .

    I got the Point and Run test case successfully.

    But I still does know there is NO. @Before/@BeforeClass and
    @After/AfterClass method.

    I think there is bug or something functionality in TestNG which I does not
    know.

    Thanks Once again!



    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/YqexPWCoTRIJ.
    For more options, visit https://groups.google.com/groups/opt_out.
  • ALISTER ERNEST at Dec 5, 2012 at 6:19 pm
    Shailesh -

    TestNG does support the "verifyText" and "verifyElement" commands. But it
    just is not done as straight forwardly as you would expect it to.
    I have been using the "Java/JUnit4/WebDriver" format to export my test
    cases from the IDE for a while now. And as an Automation QA I suggest you
    to adopt the WebDriver as well as opposed to the RC.

    And now to the actual solution, all you would have to do is to extend your
    "try - catch" block to encompass the entire test. When you do that, though
    your commands may say "assertText" or "assertEquals" they will behave as a
    verify.

    Example:

    try {
    assertEquals("TEXT1",
    driver.findElement(By.xpath("//div/table/tbody/tr/td")).getText());
    assertEquals("TEXT2",
    driver.findElement(By.xpath("//div/table/tbody/tr/td")).getText());
    assertEquals("TEXT3",
    driver.findElement(By.xpath("//div/table/tbody/tr/td")).getText());
    assertTrue(isElementPresent(By.xpath("//div/table/tbody/tr[1]/td")));
    assertTrue(isElementPresent(By.xpath("//div/table/tbody/tr[2]/td")));
    assertTrue(isElementPresent(By.xpath("//div/table/tbody/tr[3]/td")));
    } catch (Error e) { verificationErrors.append(e.toString()); }

    This will make the "asserts" behave as "verifies"

    Hope this helps.

    - Alister Ernest

    On Monday, December 3, 2012 3:43:56 AM UTC-7, Shailesh wrote:

    Hi,

    I have automating the Site in Selenium-RC in Java.

    *My Configuration –*

    1) Selenium RC - selenium-server-standalone-2.25.0.jar

    2) Eclipse – Indigo Latest.

    3) Testing-6.8.jar

    It displays error for *verifyText()* – as *“The Method
    verifyText(boolean) is undefined.”* Why it is so?



    *My Code –*

    import com.thoughtworks.selenium.*;

    import org.testng.Assert;

    import org.testng.annotations.*;

    import static org.testng.Assert.*;

    import java.util.regex.Pattern;


    public class FLOW //extends SeleneseTestNgHelper

    {

    private Selenium selenium;

    @BeforeClass

    public void setUp() throws Exception {

    selenium = new DefaultSelenium("localhost", 4444, "*firefox", "
    http://oswego.biz/");

    selenium.start();

    }

    @Test

    public void testTNF_Non_Admin_TC001() throws Exception

    {

    // Login with valid credential and see the default page should opens on
    the screen.

    try

    {

    selenium.open("/Digitalworkbook_staging/default.aspx?alias=tnf");

    }

    catch(Exception e)

    {

    selenium.waitForPageToLoad("60000");

    }

    selenium.type("id=txtUserName", "bprice");

    selenium.type("id=txtPassword", "1234");

    selenium.click("link=Login");

    selenium.waitForPageToLoad("60000");

    selenium.click("css=#ContentPlaceHolder1_viewAllPanel > table > tbody > tr
    td");

    //verifyTrue(selenium.isTextPresent("My Recent Documents"));

    //verifyTrue(selenium.isTextPresent("My Recent Documents"));

    assertTrue(selenium.isTextPresent("My Recent Documents"));


    selenium.click("//td[@id='adminContentHolder']/table/tbody/tr/td[3]/table/tbody/tr[2]/td/table/tbody/tr/td");

    //verifyTrue(selenium.isTextPresent("My Documents"));

    assertTrue(selenium.isTextPresent("My Documents"));

    selenium.click("css=td.b2bTopNav");

    selenium.click("css=td.homeWelcomeLink");

    verifyTrue(selenium.isTextPresent("Welcome bprice"));

    //assertTrue(selenium.isTextPresent("Welcome bprice"));

    }


    @AfterClass

    public void tearDown() throws Exception {

    selenium.stop();

    }

    }

    2) When I export code from Selenium IDE as “Java/TestNG/Remote Control”
    there is @Before and @After method is missing.



    Is I am doing any wrong thing?



    Waiting for Valuable reply!


    Thanks in Advance.


    Regards,

    Shailesh Jagtap.
    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/PByOGZPejx0J.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupselenium-users @
categoriesselenium
postedDec 3, '12 at 10:44a
activeDec 6, '12 at 8:47a
posts13
users5
websiteseleniumhq.org

People

Translate

site design / logo © 2022 Grokbase