Category: PHP Frameworks
Selenium | How to test popup alert message in Selenium Webdriver
Below is the script: package mypackage; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; public class myclass { public static void main(String[] args) { WebDriver driver = new FirefoxDriver(); String alertMessage = “”; driver.get(“http://demo.webnerserver.com/view/sent_email.php”) driver.findElement(By.cssSelector(“input[value=”Borrar”]”)).click(); alertMessage = driver.switchTo().alert().getText(); driver.switchTo().alert().accept(); System.out.println(alertMessage); driver.quit(); }
Mysql | How to access database remotely
To access Mysql database remotely a good way is to create a new Mysql user and grant it permissions to access database from remote, as explained below: You can create user with two ways From Mysql command prompt: 1. Open
Javascript | Unable to get content of HTML while converting HTML page to PDF
Problem : Unable to get content of HTML while converting HTML page to PDF. Solution : You can use the javascript if you want to get content of HTML while converting it into PDF : <HTML> <head> <script type=”text/javascript”> function submitForPDF() {
Salesforce | Fatal error: Uncaught SoapFault exception: [sf:REQUEST_LIMIT_EXCEEDED] REQUEST_LIMIT_EXCEEDED: TotalRequests Limit exceeded
Problem: “Fatal error: Uncaught SoapFault exception : [sf:REQUEST_LIMIT_EXCEEDED] REQUEST_LIMIT_EXCEEDED: TotalRequests Limit exceeded.” In our case, this exception was raised while upserting records in Salesforce using PHPSFDC toolkit. Solution: When our code exceeds API limit within Salesforce, it throws above exception. This
Selenium | Unable to find Command button using Selenium Webdriver
Problem: Unable to find the Command button using Selenium Webdriver. Solution: You can use following script code if you want to find command button on a web page and then click it: driver.findElement(By.xpath(“//button[text()='(Button name)’]”)).click(); Here is the script which we used in
Moodle | Flash SCORM modules not showing content on shared hosting
We faced a problem that Scorm content packages uploaded in Moodle were not displaying content correctly on shared hosting server. After entering the Quiz the page was redirecting back to the same page rather than displaying the further pages of
Selenium | Unable to find Command button using Selenium Webdriver
Problem: Unable to find the Command button using Selenium Webdriver. Solution: You can use following script code if you want to find command button on a web page and then click it: driver.findElement(By.xpath(“//button[text()='(Button name)’]”)).click(); Here is the script which we used in
Chargify | Single php function for all Chargify API calls
Following single function can be used for all Chargify API calls whether API calls belong to test site (site for test transactions) or live site (live transactions): <?php function sendRequest($uri, $method, $data = ”) { $apiKey = ‘XOTUsyy7pJ6yLgmMa233AtJ’; $subdomain =
Salesforce | [message:protected] => INVALID_LOGIN: Invalid username, password, security token; or user locked out
While upserting records using SFDC php API we were facing following exception : [message:protected] => INVALID_LOGIN: Invalid username, password, security token; or user locked out. This exception was showing up frequently when we were upserting records using PHP API. The