RE: How to open the application without providing login crdentials using TestNG?


Here is my scenario:
In TestNg suite we are providing some test cases in that while executing  testcases,for first test case  browser is opening and when it calls second test case again the browser is opening and asking login credentials .Is there any way pls provide solution.

surekha Train Asked on September 25, 2014 in Selenium WebDriver.
Add Comment
3 Answers

Hi Surekha,

Let us know your code and suite also and I didn’t understand your expectation. As per my understanding I am suggesting below code.

You do not want to launch 2 browsers correct?. If yes, you the below code.

If not, just use the proper Annotation.

Also go through the below link:



private static WebDriver driver;

public static void beforeMethod() {
driver = new FirefoxDriver();
public void main1() {
String captcha = driver.findElement(“txtCaptchaDiv”)).getText();
public void main2() {

Doctor Answered on September 26, 2014.
Add Comment

Your Answer

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