Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apostrophe escaping breaks Selenium "see" matching #15

Closed
precariouspanther opened this issue Apr 10, 2012 · 2 comments
Closed

Apostrophe escaping breaks Selenium "see" matching #15

precariouspanther opened this issue Apr 10, 2012 · 2 comments

Comments

@precariouspanther
Copy link

I've set up automated testing using Selenium and codeception, but unfortunately some of the tests fail due to the "see" action on selenium excepting apostrophes (and likely other characters).

_404Cept.php_

<?php
$I = new WebGuy($scenario);
$I->wantTo('See a friendly 404 error message for wrong url');
$I->amOnPage('/blahblahblah');
$I->see("The page you requested couldn't be found!",'h1');

Suite acceptance started
Trying to see a friendly 404 error message for wrong url (404Cept.php) - Failed

Suite functional started

Time: 7 seconds, Memory: 12.75Mb

There was 1 failure:

Couldn't see a friendly 404 error message for wrong url (404Cept.php)
Guy couldn't see ["The page you requested couldn't be found!","h1"] 'h1' selector For more details look for page snapshot in the log directory
Failed asserting that 'SEERveyThe page you requested couldn't be found!' contains _"The page you requested couldn't be found!"_.

  1. I see ["The page you requested couldn't be found!","h1"]
  2. I am on page "/blahblahblah"
  3. I want to See a friendly 404 error message for wrong url

FAILURES!
Tests: 1, Assertions: 0, Failures: 1.

However, if I remove the apostrophe (and any content after it) the test correctly identifies the content:

_404Cept.php_

<?php
$I = new WebGuy($scenario);
$I->wantTo('See a friendly 404 error message for wrong url');
$I->amOnPage('/blahblahblah');
$I->see("The page you requested couldn",'h1');

Suite unit started

Suite acceptance started
Trying to see a friendly 404 error message for wrong url (404Cept.php) - Ok

Suite functional started

Time: 8 seconds, Memory: 12.50Mb

OK (1 test, 0 assertions)

@DavertMik
Copy link
Member

Shit, i'm using addslashes for XPath.

@DavertMik
Copy link
Member

fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants