Conditional using HTMLUnit

View: New views
3 Messages — Rating Filter:   Alert me  

Conditional using HTMLUnit

by jameleon-users mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Good Morning,
 
I am trying to write tests for an ecommerce site. I select the first product on a page using an xpath expression.  The problem is, this may or may not have a ‘select size’ or ‘select color’ drop down (for example, if the first product is a bottle of perfume).
 
Using HTML unit – how can I set these select boxes only if they are present on the page. Is there a way to use conditional logic within an html unit test? Or else is there a way to skip a tag and continue the test if the element is not on the page.
 
Thanks!
Brendan Kelly
 

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Jameleon-users mailing list
Jameleon-users@...
https://lists.sourceforge.net/lists/listinfo/jameleon-users

Re: Conditional using HTMLUnit

by jameleon-users mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi Brendan,
 
The short answer is yes.
 
The long answer is there are two ways to do this:
 
- Write your own custom tag (this is the recommended way)
     There is an <if/> tag. I have some examples in the tests for jameleon-core if you learn by example. http://jameleon.svn.sourceforge.net/viewvc/jameleon/trunk/jameleon-core/tst/xml/framework/skipIfOrganization.xml?revision=1185&view=markup
 
Hope this helps,
Christian 


From: "jameleon-users@..." <jameleon-users@...>
To: "jameleon-users@..." <jameleon-users@...>; "jameleon-developers@..." <jameleon-developers@...>
Sent: Sunday, May 10, 2009 8:24:24 PM
Subject: [Jameleon-users] Conditional using HTMLUnit

Good Morning,
 
I am trying to write tests for an ecommerce site. I select the first product on a page using an xpath expression.  The problem is, this may or may not have a ‘select size’ or ‘select color’ drop down (for example, if the first product is a bottle of perfume).
 
Using HTML unit – how can I set these select boxes only if they are present on the page. Is there a way to use conditional logic within an html unit test? Or else is there a way to skip a tag and continue the test if the element is not on the page.
 
Thanks!
Brendan Kelly
 


------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Jameleon-users mailing list
Jameleon-users@...
https://lists.sourceforge.net/lists/listinfo/jameleon-users

Selenium problem

by jameleon-users mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

 

This problem is specific All New Mail of Yahoo. I was trying to automate following steps in all new yahoo mail version...

 

  1.  Login into new version of Yahoo  Mail

  1. Set your status to available (if  not already)
  2. send a mail to self. The mail  should have an attachment
  3. check if the mail has  arrived
  4. check if the correct mail is  delivered (sender, subject and attachment file name)
  5. Click on the amber/yellow dot  before the sender name
  6. verify that a new chat window is  opened.

 


I tried using selenium IDE but it did not record clicks on buttons like New, Send. So, I tried using Xpath but somehow those clicks are not carrying out expected functionality. Here is the code snippet...

 

        selenium.open("/config/login_verify2?&.src=ym");
        selenium.type("username", "xxxx");
        selenium.type("passwd", "xxxx");
        selenium.click(".save");
        selenium.waitForPageToLoad("30000");
        selenium.click("presenceIcon");       
        waitForTextPresent("Inbox");
       
        selenium.click("//*[@id=\"compose_button_label\"]");

 

 

Last line neither throw any error nor it does open new window for writing mail.

 

 

Does anyone aware of this problems?



Explore and discover exciting holidays and getaways with Yahoo! India Travel Click here!
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Jameleon-users mailing list
Jameleon-users@...
https://lists.sourceforge.net/lists/listinfo/jameleon-users