Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

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

How To capture the validation message using selenium RC Empty 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 ????? Rolling Eyes Twisted Evil Like a Star @ heaven
rohit13
rohit13
Master
Master
Posts : 180
Join date : 2012-03-29
Age : 37
Location : INDIA
http://radical-qa.blogspot.in/

How To capture the validation message using selenium RC Empty 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
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
avatar
vini546
Active particpant
Active particpant
Posts : 10
Join date : 2012-07-15
Location : Ahmedabad

How To capture the validation message using selenium RC Empty Re: How To capture the validation message using selenium RC

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

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

How To capture the validation message using selenium RC Empty 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....
rohit13
rohit13
Master
Master
Posts : 180
Join date : 2012-03-29
Age : 37
Location : INDIA
http://radical-qa.blogspot.in/

How To capture the validation message using selenium RC Empty Re: How To capture the validation message using selenium RC

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??
avatar
vini546
Active particpant
Active particpant
Posts : 10
Join date : 2012-07-15
Location : Ahmedabad

How To capture the validation message using selenium RC Empty 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 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."));

}


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

How To capture the validation message using selenium RC Empty Re: How To capture the validation message using selenium RC

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

Selenium RC + TestNg
Sponsored content

How To capture the validation message using selenium RC Empty 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