The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:




Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Testing Tools >> Seapine QA Wizard

Pages: 1
soma79
Newbie


Reged: 09/21/10
Posts: 8
How can i write a for loop for XMLPathQuery
      #642959 - 09/21/10 06:48 AM


xpath="html[1]/body[1]/form[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[1]/table[1]/tbody[1]/tr[1]/td[1]/div[1]"

sVal1=Window("Overview").Control(Window("Overview").GetControlFromXPathQuery(xpath)).Property("Inner Text")
Println sVal1

o/p - "ABC"

xpath="html[1]/body[1]/form[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[1]/table[1]/tbody[1]/tr[1]/td[1]/div[1]"

sVal1=Window("Overview").Control(Window("Overview").GetControlFromXPathQuery(xpath)).Property("Inner Text")
Println sVal1

o/p - "DEF"


If i just done the same in a for loop
for j=1 to 2
xpath="html[1]/body[1]/form[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[1]/table[1]/tbody[1]/tr[j]/td[1]/div[1]"

sVal1=Window("Overview").Control(Window("Overview").GetControlFromXPathQuery(xpath)).Property("Inner Text")
Println sVal1
next j

getting the below error message

"No control was found"

Please correct me

Thanks in Advance

Regards,
Siva


Post Extras: Print Post   Remind Me!   Notify Moderator  
Rich W.
Veteran


Reged: 03/05/04
Posts: 5815
Loc: West Coast of the East Coast!
Re: How can i write a for loop for XMLPathQuery [Re: soma79]
      #642986 - 09/21/10 09:47 AM

Which query does it fail on, j = 1, 0r j = 2?

--------------------
Personal Comment

Success is the ability to go from one failure to another with no loss of enthusiasm.
~ Winston Churchill ~


...Rich Wagner


Post Extras: Print Post   Remind Me!   Notify Moderator  
soma79
Newbie


Reged: 09/21/10
Posts: 8
Re: How can i write a for loop for XMLPathQuery [Re: Rich W.]
      #643263 - 09/23/10 05:42 AM

for both

Post Extras: Print Post   Remind Me!   Notify Moderator  
Rich W.
Veteran


Reged: 03/05/04
Posts: 5815
Loc: West Coast of the East Coast!
Re: How can i write a for loop for XMLPathQuery [Re: soma79]
      #643282 - 09/23/10 07:51 AM

Then the only thing I can see that is different is the use of the "j" for the /tr value. Why did you choose to vary the /tr value when in your examples it is always a "1"?
Just curious, I really can't say what's wrong without trying it myself, and I no longer have access to QAWP. I'd contact support. I'm sure they could tell you. Or post the question on their forum.

--------------------
Personal Comment

Success is the ability to go from one failure to another with no loss of enthusiasm.
~ Winston Churchill ~


...Rich Wagner


Post Extras: Print Post   Remind Me!   Notify Moderator  
soma79
Newbie


Reged: 09/21/10
Posts: 8
Re: How can i write a for loop for XMLPathQuery [Re: Rich W.]
      #655018 - 01/06/11 05:37 AM

for j=1 to 2
xpath="html[1]/body[1]/form[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[1]/table[1]/tbody[1]/tr["&j"]/td[1]/div[1]"

sVal1=Window("Overview").Control(Window("Overview").GetControlFromXPathQuery(xpath)).Property("Inner Text")
Println sVal1
next j

Thanks,
Siva


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 2 anonymous users are browsing this forum.

Moderator:  AJ 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 3550

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5