2

Our web application is designed such that the text transform is picked from CSS. There are multiple links on a webpage; hence i will take example of a Next link.

When i hover the mouse over Next link in FF, it shows the below code: _click(_link("Next"));

Similarly when i hover the mouse over the same link in Chrome, it shows the below code: _click(_link("NEXT"));

When the script is recorded in FF and executed in chrome, it fails at the location because "Next" link is unavailable. This is one example of a link and there are multiple links and multiple pages. For this scenario, do i need to verify the text for each link or is there a universal way i.e. toLowercase method that can help me.

Thanks.

2 Answers2

2

I think, the question should be how can Sahi identify the element with text by ignoring the case-sensitivity. Any tool can only record the attributes which is available on the browser at that time.

You can use the following code to achieve the functionality:

_click(_link("/Next/i"));
Tony Stark
  • 8,064
  • 8
  • 44
  • 63
Kshitij Gupta
  • 410
  • 1
  • 3
  • 9
2

As Kshitij pointed out, you can get this working by using a regular expression as your accessor... but you might also check the Alternatives pulldown in the Controller. Perhaps there's an alternative accessor that is better suited for both browsers.

Brine
  • 3,733
  • 1
  • 21
  • 38
  • Hey Brian, I see you have experience with Sahi and also Protractor. Do you have an opinion on which tools is better suited for testing Angular apps? – Leo Gallucci Sep 27 '14 at 20:52
  • 1
    Hey Leo, because of Protractor's ability to locate models/bindings, it would seem to have the leg-up for testing Angular apps. And because it sits on top of WebDriver, Protractor might also have a brighter future on mobile. That said, Sahi is indeed a good tool, and could certainly be used on Angular apps. Sahi's strength (IMO) is its ease of use... very nice for QA teams with less coding knowledge. – Brine Sep 28 '14 at 22:17