Author Topic: Need suggestion regarding the scenario  (Read 1076 times)

Offline test king

  • Sr. Member
  • ****
  • Posts: 320
  • Software Engineer
Need suggestion regarding the scenario
« on: February 05, 2009, 08:20:33 am »
hi friends

This is my datatable and A b and c are the three columns present in excel and i am importing
it in to the datatable

    A               B     C

1.Parent1 Child1 Page1   
2.Parent2 Child2 Page2
                     Page2.1
                  Page2.2
3.Parent3         Page3
4.Parent4 Child4  ""
5.Parent5   ""        ""


I have to create parentfolder,child folder and pages, by selecting the corresponding parent
folder to select child folder.By selecting parent folder, child folder i have to create Page.

1.scenario 1
If parent folder exist then  i have to select the parent folder and then i have to create
child folder below the selected parent folder. If childfolder exist then  have to select the
child folder and  i have to create page below the selected child folder.

2.Scenario 2
Below one parent folder and child folder there may be number of pages which should be added below the
corresponding parent and child folder which is selected.

3.Scenario 3
If there is parent folder and i can create pages directly,no need of childfolder.

4.Scenario 4
I can create parent and child folder without pages

5.Scenario 5
I can create parent folder alone without childfolder and pages

   Here parent1,child1 and page1 are identified as webelement. if validation is done based on
webelement name, is not an apt soultion. Here is the reason for not selecting webelement name
and validating it.

if Browser(B).Page(p).Webelement(parent1).exist then
  //code here to select the parent, child and page
end if

if the validation is checked through the webelement name the problem will exist by selecting
second row, because again i have to repeat the code for parent2 again because webelement name
differs.

if Browser(B).Page(p).Webelement(parent2).exist then
  //code here to select the parent, child and page
end if

So by default code will increase and it is very similar to manual testing. How can i handle the
scenario through automation let me know??

Thanks
testking123

Offline Tarun Lalwani

  • Administrator
  • Hero Member
  • *****
  • Posts: 3037
    • KnowledgeInbox
Re: Need suggestion regarding the scenario
« Reply #1 on: February 05, 2009, 12:09:31 pm »
What is the feature that you are testing? I could somewhat understand the issue, basically you have problem recognizing different elements. You would need to use DP in this case

http://knowledgeinbox.com/articles/qtp/descriptive-programming/
Regards,
Tarun
KnowledgeInbox Administrator

KnowledgeInbox" style="border:0

Offline test king

  • Sr. Member
  • ****
  • Posts: 320
  • Software Engineer
Re: Need suggestion regarding the scenario
« Reply #2 on: February 06, 2009, 02:20:15 am »
hi tarun,

Right now i am using DP to identify objects but here the problem is i have to create folder and pages in a form
the hierarchy will be

parent folder
-child folder
--pages

here i am facing difficulty in validating the folder each and every time i have to check whether the object exist. if exist then i have to add corresponding folders below it.

if parent(p1). exist then add child folder. if parent and child exist then i should add pages below it

In my scenario i  am fecthing value from datatable

if i validate functionality using name the function will 100% fail in the second iteration because the parent folder, child folder name will be different in this scenario  what should i do to validate these type of scenario.Let me know i am waiting for your reply

Thanks,
testking123

Offline Tarun Lalwani

  • Administrator
  • Hero Member
  • *****
  • Posts: 3037
    • KnowledgeInbox
Re: Need suggestion regarding the scenario
« Reply #3 on: February 06, 2009, 04:06:50 am »
I am still not able to get the issue that you are facing.
Regards,
Tarun
KnowledgeInbox Administrator

KnowledgeInbox" style="border:0