QA/Execution/Web Testing/Selenium Guidelines: Difference between revisions

No edit summary
Line 7: Line 7:
* wherever possible, use relative--not absolute--URLs in |open| commands
* wherever possible, use relative--not absolute--URLs in |open| commands
=PHP=
=PHP=
* Locating elements
** xpath: for elements that have dynamically generated xpaths use 'contains'.
          for e.g. if xpath for 'remove add-on' link has the add-on ID
          in it (id('addon-2464')/a[1]) and we do not know the add-on ID then
          we can write the xpath with 'contains'
          //div[@id,'addon-2464'][2]/a[1]) => //div[contains(@id,'addon- ')][2]/a[1]
169

edits