webtestLogin(); $this->openCiviPage('contact/add', 'reset=1&ct=Individual'); $firstName = substr(sha1(rand()), 0, 7); $lastName1 = substr(sha1(rand()), 0, 7); $email = "{$firstName}@example.com"; $lastName2 = substr(sha1(rand()), 0, 7); //contact details section //select prefix $this->click("prefix_id"); $this->select("prefix_id", "value=3"); //fill in first name $this->type("first_name", "$firstName"); //fill in last name $this->type("last_name", "$lastName1"); //fill in email $this->type("email_1_email", "$email"); //check for matching contact //$this->click("_qf_Contact_refresh_dedupe"); //$this->waitForPageToLoad($this->getTimeoutMsec()); // Clicking save. $this->click("_qf_Contact_upload_view"); $this->waitForPageToLoad($this->getTimeoutMsec()); $this->waitForText('crm-notification-container', "Contact Saved"); $this->openCiviPage('contact/add' , 'reset=1&ct=Individual'); //contact details section //fill in first name $this->type("first_name", "$firstName"); //fill in last name $this->type("last_name", "$lastName1"); //fill in email $this->type("email_1_email", "$email"); // Clicking save. $this->click("_qf_Contact_upload_view"); $this->waitForPageToLoad($this->getTimeoutMsec()); $this->assertElementContainsText("css=.notify-content", "Please correct the following errors in the form fields below: One matching contact was found. You can View or Edit the existing contact."); } }