selenium - how effectively i can use ui automation recorded test cases for other releases of the application -


i've web application, want recorded test cases , play cases.

1st release of application, i've login module has user name , password , recorded 500 test cases entire application. among 500 test cases 200 test cases using logging username , password.

2nd release of application, i've login module has username, want use previous recorded test cases modifications not go test cases change password field. here i'm having requirements testing framework

  • can test cases effect changing field in above example?
  • there way update in simple, not going in files , changing

i've used different ui automation testing tools , record & play options nice, not find way want in ui automation test framework.

is there framework available job me?

thanks in advance.

this prime example of why never should record selenium test case. whenever want update login have change them all.

what should create test harness/framework application.

1.start creating class each webpage 1 function each element want able reach.

public username(){    return by.cssselector("input[id$='username']");   } 

2.create helper classes create sequences use often.

public void login(string username, string password){        items.username().sendkeys(username);       items.password().sendkeys(password); 

}

3.in common test setup add login function

@beforemethod(alwaysrun = true) public void setup() {    helper.login("user","password"); 

}

this give opportunity programmaticly create test cases. example if want use same test cases different login module password element not present changed this.

items.username().sendkeys(username);     if(iselementpresent(items.password())     items.password().sendkeys(password); 

the function "iselementpresent" this

public boolean iselementpresent(by locator){     try {       driver.findelement(locator);       logger.trace( "element " + stripby(locator) + " found");     } catch (nosuchelementexception e) {       logger.trace( "element " + stripby(locator) + " not found");       return false;     }    return true;   } 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -