on 09-10-2008 10:39 AM
Hi Experts,
I am new to Ruby and Watir. I want to create the test scripts for testing Portal Applications.
I came across the wonderful blogs written by Justin Ramel link of which is
/people/justin.ramel/blog
Blog is great for starters like me.
My problem is how to navigate to particular Portal Work Center (I believe its Top Level Navigation) and then to Detailed Navigation Tree
and then on iView screens.
I just want to add that I have no experience working with PAR files.
Thanks and Regards,
Gopal
See the above post
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gopal,
let me give you some hints on how to operate with Watir and the SAP Portal.
1.
You should install IE Developer Toolbar (just search for it in Google). This will help you in finding the right DOM-Objects for which you have to search in Watir.
The process is always:
- Try to find the link you want to click in IE Developer Toolbar
- Try to find a unique selection for this link in Watir
- Code it in Watir and test if the results meet your expectations
2.
If you just want to navigate after a successfull logon in the TLN it is just:
...
title='Top Level Entry Point Name'
@ie.link(:text, "#{title}").click
...
3.
If you want to click a detailed navigation link it is a little bit more:
...
@ie.frame(:index, 3).link(:text, "#{title}")
...
The trick here is to find the right frame were the detailed navigation link can be found. In current SAP 7.0 Portal this is the iframe with the index 3.
Of course every link you want to click has to be visible to the user in the browser. So you have to click the 1. navigation level first to make the 2. navigation level visible and so on.
4.
If you want to check the content frame than you have to find the correct iframe again:
...
@ie.frame(:index, 3).frame(:index, 4) # could be also index 3 or 2 !
..
The hard part here is to check which index the contentFrame has. I found it could be 4,3 or 2. This depends on how the content is organized.
It could also be that there is no contentFrame because your content is embeeded.
I hope this gives you an introduction how to code portal navigation in Watir.
Best regards,
Stefan Brauneis
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stefan,
Thanks for helpful response.
Well I was not able to navigate to TLN itself. After logging in to portal I want to go to the respective Work Center
which is having text as "Work Center 1". As told by you I installed IE Developer Toolbar. I tried to pass on the ID
also but was not successful. Looking into the Developer Toolbar, I found out that the required Work Center div tag is
nested deep into the body HTML tag. Do we have to give the full path for triggering the click event as follows
@ie.div(:id,'DIV1').table(:id, 'table1').........................div(:id,'deep nested div').link(:text,'Work Center 1')
Following is the error when i try @ie.link(:text,'Work center 1').click
1) Error:
test_login(MyFirstTC):
Watir::Exception::UnknownObjectException: Unable to locate object, using text an
d Work center 1
c:/program files/ruby/lib/ruby/site_ruby/1.8/watir.rb:1928:in `assert_exists
'
c:/program files/ruby/lib/ruby/site_ruby/1.8/watir.rb:2009:in `click'
TestPortalApp.rb:13:in `test_login'
Best Regards,
Gopal
Edited by: Gopal on Sep 11, 2008 10:02 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.