We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,860 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

How to combine two xpath conditions with 'and'

I am just learning Xpath.

How to mix 2 or more xpath validtions into a single line.

On my page, I have 2 different tables under hthe //body tag.
I want to validate two td s that exist on these 2 different tables.

IsElementPresent is my own method. It uses Xpath.

field.IsElementPresent("//td[text()='End']");
field.IsElementPresent("//span[text()='variables']");

I tried [//td[text()='End'] and //span[text()='variables'] ].
This is failed.

1
Contributor
1
Reply
1 Hour
Discussion Span
2 Months Ago
Last Updated
4
Views
bs111
Newbie Poster
2 posts since Mar 2013
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Here is the answer:

//body [table//td[text()='End'] and //table//td[text()='wel'] and //td[text()='oo'] and //span[text()='variables'] ]

bs111
Newbie Poster
2 posts since Mar 2013
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0589 seconds using 2.65MB