How to run an exported selenium test case using TestNG in Eclipse -


i recorded test case using selenium ide 1.10.0. exported case java/testng/remote control.

my eclipse version 4.2.0 , installed testng plug-in version 6.8

i wondering how can create project within eclipse run exported test case?

please give me instructions or share me online tutorial / documentations. thanks!

below java code generated eclipse:

package com.example.tests;  import com.thoughtworks.selenium.*; import org.testng.annotations.*; import static org.testng.assert.*; import java.util.regex.pattern;  public class searchdonor extends selenesetestnghelper {     @test public void testsearchdonor() throws exception {         // set overall speed of test case         selenium.setspeed("4000");         selenium.open("/?html=openid");         selenium.click("css=input[type=\"submit\"]");         selenium.waitforpagetoload("30000");         thread.sleep(4000);         selenium.click("id=cmp_admin");         selenium.waitforpagetoload("30000");         selenium.click("id=quicksearch_anchor");         selenium.click("css=img[alt=\"member\"]");         selenium.waitforpagetoload("30000");         selenium.type("id=search_name", "suzy");         selenium.click("css=input[type=\"image\"]");         selenium.click("link=balagia, suzy");         selenium.waitforpagetoload("30000");     } } 

after trial , errors. managed execute exported code in eclipse testng test. here steps took make compile.

1.created java project within eclipse

2.add class java project

2a. copied , pasted code newly created class 

3.right click on project>build path>configure build path

3a. on java build path window select libraries>add external jars, adding jar files selenium java driver folder (e.g. folder name in case libs), plus selenium-java-2.31.0.jar , selenium-java-2.31-src.jar

4.click run icon next debug icon on top menu bar, run testng test

my code compiling, got exception errors. getting stared on testng test case!


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -