XPath

How to dynamically generate xpath by xpath axis 

xpath axis How to dynamically generate xpath by xpath axis

xpath axis image


We can dynamically generate xpath for a control on a web page by xpath axis.
For example, we want to locate “Add ” button by its corresponding category name, say “test” or “driving instructor”.

More…

By BiLi on September 14, 2010 | XPath | 2 comments
Tags:

How do I set or change the PATH system variable 

Setting Path on Windows

For Windows XP: More…

By Pavandeep Puddupakkam on March 2, 2010 | Automation Tips, XPath | 1 comment
Tags: , ,

Selenium – Invalid xpath [3]: XPath parse error 

I was getting this error : Invalid xpath [3]: XPath parse error when I used xpath xpath=id(‘**IIIIIIHHHHHHHHHHHH’)[@href]. The solution is xpath=//a[@id='**IIIIIIHHHHHHHHHHHH'][@href]. Here I used //a as this was the tag id for the element.

More…

By Pavandeep Puddupakkam on February 28, 2010 | Automation Tips, XPath | A comment?
Tags:

Use Selenium to verifying the meta tag element using xpath 

There is a great need today to validate the meta tags and the contents on a website for google indexing and SEO. Here is an example of using Xpath in selenium to verify the meta tags and the contents.

More…

By Pavandeep Puddupakkam on February 20, 2010 | Automation Tips, Selenium RC, Software Testing, XPath | 1 comment
Tags: ,

How to use selenium to check for google analytics on a web page 

I have used xpath to verify if a particular string is available on the web page. Using the same concept I am now able to verify if google analytics code is available on the web page.
Here is the example:
Say my google analytics code is something like this:
[JavaScript]script type=“text/javascript”
try {
var pageTracker = _gat._getTracker(“UA-222222-3″);
pageTracker._trackPageview();
} catch(err) {}script
[/JavaScript]
The xpath for that is //script[@type="text/javascript"][contains(text(), 'UA-222222-3')]
Then you use verifyElementPresent in selenium. I hope this will be useful for you all.

<tr>
<td>verifyElementPresent</td>
<td>//script[@type='text/javascript'][contains(text(), 'UA-222222-3')]</td>
<td></td>
</tr>

Submitted by Puddupakkam Pavandeep

By Pavandeep Puddupakkam on February 19, 2010 | Automation Tips, Selenium RC, Software Testing, XPath | A comment?
Tags: , ,

Working with xpath and selenium 

When element doesn’t contain any id and name, using xpath to find the element is very important for writing selenium test. I list some sample locate for the element which doesn’t contain id or name.

More…

By Pavandeep Puddupakkam on February 18, 2010 | Automation Tips, Selenium RC, Software Testing, XPath | A comment?
Tags: