Share
Go down
vini546
Active particpant
Active particpant
Posts : 10
Join date : 2012-07-15
Location : Ahmedabad

How To capture the validation message using selenium RC

on 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 ????? Rolling Eyes Twisted Evil Like a Star @ heaven
avatar
rohit13
Master
Master
Posts : 180
Join date : 2012-03-29
Age : 31
Location : INDIA
http://radical-qa.blogspot.in/

Re: How To capture the validation message using selenium RC

on Mon Jul 16, 2012 11:35 am
If it is Java script alert then you can use
Code:
assertEquals("Invalid User ID or password", selenium.getAlert());
OR
Code:
assertTrue(selenium.isTextPresent("Invalid User ID or password"));

let me know whether it is working for you Smile

_________________
Radical QA
http://radical-qa.blogspot.in/
vini546
Active particpant
Active particpant
Posts : 10
Join date : 2012-07-15
Location : Ahmedabad

Re: How To capture the validation message using selenium RC

on Mon Jul 16, 2012 12:58 pm
Yuppp...Its working Sad Arrow

Thanqqq...Great job
ajit007
Posts : 1
Join date : 2012-07-18

Re: How To capture the validation message using selenium RC

on Thu Jul 26, 2012 11:01 am
if i am giving the particular command its not capturing the alert message....
avatar
rohit13
Master
Master
Posts : 180
Join date : 2012-03-29
Age : 31
Location : INDIA
http://radical-qa.blogspot.in/

Re: How To capture the validation message using selenium RC

on Thu Jul 26, 2012 12:23 pm
ajit007 wrote:if i am giving the particular command its not capturing the alert message....
Provide more information related to validation message, is it java script pop-up??

_________________
Radical QA
http://radical-qa.blogspot.in/
vini546
Active particpant
Active particpant
Posts : 10
Join date : 2012-07-15
Location : Ahmedabad

Re: How To capture the validation message using selenium RC

on 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 bounce

// 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."));

}


vini546
Active particpant
Active particpant
Posts : 10
Join date : 2012-07-15
Location : Ahmedabad

Re: How To capture the validation message using selenium RC

on Tue Jul 31, 2012 5:52 pm
It gives Better Outputs with following tongue Question

Selenium RC + TestNg
Sponsored content

Re: How To capture the validation message using selenium RC

Back to top
Permissions in this forum:
You cannot reply to topics in this forum