FAQ
Hello ,

I am running selenium 2.21 with testng and maven , this is my first time i
am setting it up at test ng .

So i wrote this

testng.xml

Here are content of testng.xml.


<suite name="Login Suite" >
<test name="Login Test">
<classes>
<class name="com.proferi.qe.uitest.LoginTest" />
</classes>
</test>

</suite>

here is my pom.xml file




<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.20.0</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>${testng.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-chrome-driver</artifactId>
<version>2.20.0</version>
</dependency>


</dependencies>

<repositories>
<repository>
<id>Selenium</id>
<name>Selenium Repository</name>

<url>http://repo1.maven.org/maven2/org/seleniumhq/selenium/</url>
</repository>
</repositories>


<build>

<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
<suiteXmlFiles>

<suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
<executions>
<execution>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<skip>false</skip>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>

</build>


Now when i am running my test its not closing my test browser window and
looks like that test are stuck.



--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/eGzFZ_aEJ1EJ.
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 this group at http://groups.google.com/group/selenium-users?hl=en.

Search Discussions

  • LachelnKind at Apr 25, 2012 at 3:04 am
    Please post your code in your Test. Are you using driver.close() or
    driver.quit() ?
    On Apr 24, 6:43 pm, Web User wrote:
    Hello ,

    I am running selenium 2.21 with testng and maven , this is my first time i
    am setting it up at test ng .

    So i wrote this

    testng.xml

    Here are content of testng.xml.

    <suite name="Login Suite" >
    <test name="Login Test">
    <classes>
    <class name="com.proferi.qe.uitest.LoginTest" />
    </classes>
    </test>

    </suite>

    here is my pom.xml file

    <dependencies>
    <dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>${junit.version}</version>
    </dependency>
    <dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>2.20.0</version>
    </dependency>
    <dependency>
    <groupId>org.testng</groupId>
    <artifactId>testng</artifactId>
    <version>${testng.version}</version>
    <scope>test</scope>
    </dependency>
    <dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-chrome-driver</artifactId>
    <version>2.20.0</version>
    </dependency>

    </dependencies>

    <repositories>
    <repository>
    <id>Selenium</id>
    <name>Selenium Repository</name>

    <url>http://repo1.maven.org/maven2/org/seleniumhq/selenium/</url>
    </repository>
    </repositories>

    <build>

    <resources>
    <resource>
    <directory>src/main/resources</directory>
    <filtering>true</filtering>
    </resource>
    </resources>

    <plugins>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-resources-plugin</artifactId>
    <version>2.5</version>
    <configuration>
    <encoding>UTF-8</encoding>
    </configuration>
    </plugin>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>
    <skip>true</skip>
    <suiteXmlFiles>

    <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
    </suiteXmlFiles>
    </configuration>
    <executions>
    <execution>
    <phase>integration-test</phase>
    <goals>
    <goal>test</goal>
    </goals>
    <configuration>
    <skip>false</skip>
    </configuration>
    </execution>
    </executions>
    </plugin>
    <plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>2.3.2</version>
    <configuration>
    <source>1.6</source>
    <target>1.6</target>
    </configuration>
    </plugin>
    </plugins>

    </build>

    Now when i am running my test its not closing my test browser window and
    looks like that test are stuck.
    --
    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 this group at http://groups.google.com/group/selenium-users?hl=en.
  • Web User at Apr 25, 2012 at 3:20 am
    I am using driver.quit();

    On Tuesday, April 24, 2012 6:43:57 PM UTC-7, Web User wrote:

    Hello ,

    I am running selenium 2.21 with testng and maven , this is my first time i
    am setting it up at test ng .

    So i wrote this

    testng.xml

    Here are content of testng.xml.


    <suite name="Login Suite" >
    <test name="Login Test">
    <classes>
    <class name="com.proferi.qe.uitest.LoginTest" />
    </classes>
    </test>

    </suite>

    here is my pom.xml file




    <dependencies>
    <dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>${junit.version}</version>
    </dependency>
    <dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>2.20.0</version>
    </dependency>
    <dependency>
    <groupId>org.testng</groupId>
    <artifactId>testng</artifactId>
    <version>${testng.version}</version>
    <scope>test</scope>
    </dependency>
    <dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-chrome-driver</artifactId>
    <version>2.20.0</version>
    </dependency>


    </dependencies>

    <repositories>
    <repository>
    <id>Selenium</id>
    <name>Selenium Repository</name>
    <url>http://repo1.maven.org/maven2/org/seleniumhq/selenium/
    </url>
    </repository>
    </repositories>


    <build>

    <resources>
    <resource>
    <directory>src/main/resources</directory>
    <filtering>true</filtering>
    </resource>
    </resources>

    <plugins>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-resources-plugin</artifactId>
    <version>2.5</version>
    <configuration>
    <encoding>UTF-8</encoding>
    </configuration>
    </plugin>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>
    <skip>true</skip>
    <suiteXmlFiles>

    <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
    </suiteXmlFiles>
    </configuration>
    <executions>
    <execution>
    <phase>integration-test</phase>
    <goals>
    <goal>test</goal>
    </goals>
    <configuration>
    <skip>false</skip>
    </configuration>
    </execution>
    </executions>
    </plugin>
    <plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>2.3.2</version>
    <configuration>
    <source>1.6</source>
    <target>1.6</target>
    </configuration>
    </plugin>
    </plugins>

    </build>


    Now when i am running my test its not closing my test browser window and
    looks like that test are stuck.


    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/TTvaIq3rITkJ.
    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 this group at http://groups.google.com/group/selenium-users?hl=en.
  • Web User at Apr 25, 2012 at 3:21 am
    Here is my code

    public class LoginTest extends TestBase {
    // private static final ProferiLogger LOG =
    LogFactory.getLogger(Login.class);
    private StringBuffer verificationErrors = new StringBuffer();
    private String baseUrl;
    @BeforeClass
    public void testInit() {
    baseUrl = "....";
    // Load the page in the browser
    webDriver.get(baseUrl + "/login.php");
    webDriver.manage().timeouts().implicitlyWait(3000,
    TimeUnit.SECONDS);

    }

    /**
    *
    * The test method for the verify the title for Tide mark Sign in page.
    *
    * @param args
    * Not used
    */
    @Ignore//@Test
    public void testVerifytitle() {
    Assert.assertEquals("Login", webDriver.getTitle());
    }
    }

    Test BAse class is

    public class TestBase {

    protected WebDriver webDriver;

    protected String websiteUrl;

    protected Browser browser;

    @BeforeSuite(alwaysRun = true)
    public void init() {
    websiteUrl = System.getProperty("site.url");
    browser = new Browser();
    browser.setName(System.getProperty("browser.name"));
    browser.setVersion(System.getProperty("browser.version"));
    browser.setPlatform(System.getProperty("browser.platform"));

    String username = System.getProperty("user.username");
    String password = System.getProperty("user.password");

    webDriver = WebDriverFactory.getInstance(browser.getName(),
    username,
    password);
    webDriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
    }

    @AfterSuite()
    public void tearDown() {
    System.out.println("Inside Test Base");

    webDriver.quit();

    }

    }
    On Tuesday, April 24, 2012 6:43:57 PM UTC-7, Web User wrote:

    Hello ,

    I am running selenium 2.21 with testng and maven , this is my first time i
    am setting it up at test ng .

    So i wrote this

    testng.xml

    Here are content of testng.xml.


    <suite name="Login Suite" >
    <test name="Login Test">
    <classes>
    <class name="com.proferi.qe.uitest.LoginTest" />
    </classes>
    </test>

    </suite>

    here is my pom.xml file




    <dependencies>
    <dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>${junit.version}</version>
    </dependency>
    <dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>2.20.0</version>
    </dependency>
    <dependency>
    <groupId>org.testng</groupId>
    <artifactId>testng</artifactId>
    <version>${testng.version}</version>
    <scope>test</scope>
    </dependency>
    <dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-chrome-driver</artifactId>
    <version>2.20.0</version>
    </dependency>


    </dependencies>

    <repositories>
    <repository>
    <id>Selenium</id>
    <name>Selenium Repository</name>
    <url>http://repo1.maven.org/maven2/org/seleniumhq/selenium/
    </url>
    </repository>
    </repositories>


    <build>

    <resources>
    <resource>
    <directory>src/main/resources</directory>
    <filtering>true</filtering>
    </resource>
    </resources>

    <plugins>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-resources-plugin</artifactId>
    <version>2.5</version>
    <configuration>
    <encoding>UTF-8</encoding>
    </configuration>
    </plugin>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>
    <skip>true</skip>
    <suiteXmlFiles>

    <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
    </suiteXmlFiles>
    </configuration>
    <executions>
    <execution>
    <phase>integration-test</phase>
    <goals>
    <goal>test</goal>
    </goals>
    <configuration>
    <skip>false</skip>
    </configuration>
    </execution>
    </executions>
    </plugin>
    <plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>2.3.2</version>
    <configuration>
    <source>1.6</source>
    <target>1.6</target>
    </configuration>
    </plugin>
    </plugins>

    </build>


    Now when i am running my test its not closing my test browser window and
    looks like that test are stuck.


    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/09yenIFfDA8J.
    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 this group at http://groups.google.com/group/selenium-users?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupselenium-users @
categoriesselenium
postedApr 25, '12 at 1:44a
activeApr 25, '12 at 3:21a
posts4
users2
websiteseleniumhq.org

2 users in discussion

Web User: 3 posts LachelnKind: 1 post

People

Translate

site design / logo © 2021 Grokbase