Selenium | How to test popup alert message in Selenium Webdriver

| By Webner

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(); }

Javascript | Unable to get content of HTML while converting HTML page to PDF

| By Webner

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

| By Webner

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

| By Webner

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

| By Webner

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

| By Webner

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

| By Webner

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

| By Webner

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