how to validate
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Milan_Dwivedi
Posted On:   Thursday, October 8, 2009 02:29 AM

I am working on Selenium tool in that i am using Junit, in the code i am trying to access an another web testing tool with user id and password and i dont know how to validate the user name and password...so please suggest me the appropriate method...thanks in advance..below is the code which i am using.. package com.example.tests; import com.thoughtworks.selenium.SeleneseTestCase; public class jj1 extends SeleneseTestCase { public void setUp() throws Exception { setUp("http://192.168.5.190/", "*iexplore"); } public void testLogoutJ() throws Exception { selenium.open("/"); selenium.click("link=login.php"); selenium.waitForPageT   More>>

I am working on Selenium tool in that i am using Junit, in the code i am trying to access an another web testing tool with user id and password and i dont know how to validate the user name and password...so please suggest me the appropriate method...thanks in advance..below is the code which i am using..

package com.example.tests;

import com.thoughtworks.selenium.SeleneseTestCase;

public class jj1 extends SeleneseTestCase {
public void setUp() throws Exception {
setUp("http://192.168.5.190/", "*iexplore");
}

public void testLogoutJ() throws Exception {
selenium.open("/");
selenium.click("link=login.php");
selenium.waitForPageToLoad("30000");
selenium.type("username", "milan");
selenium.type("password", "milan");
selenium.click("//input[@value='Login']");
selenium.waitForPageToLoad("30000");
}
}

   <<Less

Re: how to validate

Posted By:   Milan_Dwivedi  
Posted On:   Thursday, October 8, 2009 07:20 AM

Hi Friends, i got the solution of my problem so this is the solution:

if(selenium.isTextPresent("Logged in as: administrator (administrator)")){
System.out.print("Login Successful.");}
else {
System.out.print("Login Unsuccessful.");
}

i am using the above code after the code of login.
About | Sitemap | Contact