- vini546Active particpant
- Posts : 10
Join date : 2012-07-15
Location : Ahmedabad
How To capture the validation message using selenium RC
Sun Jul 15, 2012 10:46 am
Hello everyone,
I am new to Selenium and I'l face lot of problems with capturing alert message
EX: If we Enter Invalid User name and password It displays the alert message like "Invalid User ID or password"
I am using IsTextPresent() to capture the actual message...but its not working..
please tell me how to capture the actual message ?????
I am new to Selenium and I'l face lot of problems with capturing alert message
EX: If we Enter Invalid User name and password It displays the alert message like "Invalid User ID or password"
I am using IsTextPresent() to capture the actual message...but its not working..
please tell me how to capture the actual message ?????
Re: How To capture the validation message using selenium RC
Mon Jul 16, 2012 11:35 am
If it is Java script alert then you can use
let me know whether it is working for you
- Code:
assertEquals("Invalid User ID or password", selenium.getAlert());
- Code:
assertTrue(selenium.isTextPresent("Invalid User ID or password"));
let me know whether it is working for you
- vini546Active particpant
- Posts : 10
Join date : 2012-07-15
Location : Ahmedabad
Re: How To capture the validation message using selenium RC
Mon Jul 16, 2012 12:58 pm
Yuppp...Its working
Thanqqq...Great job
Thanqqq...Great job
- ajit007
- Posts : 1
Join date : 2012-07-18
Re: How To capture the validation message using selenium RC
Thu Jul 26, 2012 11:01 am
if i am giving the particular command its not capturing the alert message....
Re: How To capture the validation message using selenium RC
Thu Jul 26, 2012 12:23 pm
Provide more information related to validation message, is it java script pop-up??ajit007 wrote:if i am giving the particular command its not capturing the alert message....
- vini546Active particpant
- Posts : 10
Join date : 2012-07-15
Location : Ahmedabad
Re: How To capture the validation message using selenium RC
Tue Jul 31, 2012 5:50 pm
Hello Ajit,
When Ever you want to capture an Alert message,Use this below command.Most of the times its working..For ur convenience I'l attach sample code
// Valid User name and Empty password
@Test public void Case2() throws Exception {
Thread.sleep(3000);
selenium.type("id=passwd", "");
selenium.highlight("id=button2");
selenium.click("id=button2");
Thread.sleep(3000);
verifyTrue(selenium.isTextPresent("Enter your login name and password."));
}
When Ever you want to capture an Alert message,Use this below command.Most of the times its working..For ur convenience I'l attach sample code
// Valid User name and Empty password
@Test public void Case2() throws Exception {
Thread.sleep(3000);
selenium.type("id=passwd", "");
selenium.highlight("id=button2");
selenium.click("id=button2");
Thread.sleep(3000);
verifyTrue(selenium.isTextPresent("Enter your login name and password."));
}
- vini546Active particpant
- Posts : 10
Join date : 2012-07-15
Location : Ahmedabad
Re: How To capture the validation message using selenium RC
Tue Jul 31, 2012 5:52 pm
It gives Better Outputs with following
Selenium RC + TestNg
Selenium RC + TestNg
Permissions in this forum:
You cannot reply to topics in this forum