Toggling a checkbox on/off through Selenium webdriver

Author - Webner
|
0 Comments
|

Below is the script for on/off the checkbox using webdriver:
package mypackage;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class myclass
{
public static void main(String[] args)
{
WebDriver driver = new FirefoxDriver();
String Read more…

How to create a dynamic div using Javascript

Author - Webner

Here is sample code if you want to create a dynamic div using Javascript:

<script type=”text/javascript”>
divCount =0;
function createDiv()
{
var divTag = document.createElement(“div”);
var studList =””;
studList += ‘<select id=”BOX_’+divCount+'” name=”BOX_’+divCount+'”>’;
studList += ‘<option value=””>— Select —</option&gt Read more…

Salesforce | Some Date functions (String to Date and more)

Author - Webner
|
0 Comments
|

We can convert a string variable into date datatype by using the apex date class function date.parse(String);

Syntax:

Date var1=date.parse(String);

Example:

String var=’12/25/2016’;

Convert var to date type by:
Date var1=date.parse(var);

Now var1 contain it as a date type Read more…

Android | How to get list of all the apps installed on Android device

Author - Vivek Gautam
|
0 Comments
|

In one of the mobile app we were required to get the list of all the installed applications on user’s mobile. This was possible but due to security reasons first of all you need to prompt app user to allow access his/her device contents by showing a dialogue Read more…

Selenium | How to test popup alert message in Selenium Webdriver

Author - 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 Read more…

Salesforce | Calculate number of years between two dates in apex class

Author - Shalini
|
0 Comments
|

Sample Code:

Date date1 = System.today();
Date date2 = System.today().addMonths(30);
system.debug(‘No of months === >>>> ‘ + date1.monthsBetween(date2));
String noOfYears = String.valueOf(date1.monthsBetween(date2) / 12) + ‘ Year(s) ‘ + String.valueOf(Math.mod(date1.monthsBetween(date2), 12)) + ‘ Month(s)’;
system.debug(‘No of years ‘ + noOfYears);

Output:

No of months Read more…

PHP | Amazon S3 | Check if a file or folder already exists on Amazon S3 Bucket

Author - Webner

To check if a file or folder already exists on Amazon S3 Bucket, use the following code

Code:
$info = $client->doesObjectExist($bucket, $FileName)
if ($info)
{
echo ‘File exists’;
}
else
{
echo ‘File does not exists’;
}

Webner Solutions is a Software Development company focused on developing CRM apps (Salesforce, Zoho), LMS Read more…

Salesforce | Visualforce | Error : DML currently not allowed exception on creation of the record on an Object

Author - Webner
|
0 Comments
|

When creating a record on the document object using Rest API, Salesforce did not allow to execute the DML command from the Visualforce component.

Reason: When we try to pass dynamic values from the Visualforce Component to the Apex method, Salesforce does not allow us to put any Read more…

Mysql | How to access database remotely

Author - Kiran Preet

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 command prompt.

2. Open the terminal of MYSQL Read more…

List of English phrases that can confuse the reader

Author - Webner
|
0 Comments
|

1. A penny for your thoughts: A way of asking what someone thinks about something.

Example: The new Salesforce Internet of Things (IoT) can be the next big thing, a penny for your thoughts?

2. Back to the drawing board: When an attempt fails and work needs to be started Read more…

HTML | WordPress | pre tag not working

Author - Webner
|
0 Comments
|

When pre tag is used in WordPress to include code which contains tags like apex, pre does not work.

For Example:
<apex:page standardController=”Event”>

The above code displays empty screen when used in the pre tag.

Solution: Replace < with &lt; and > with &gt Read more…

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

Author - 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()
{
document.getElementById(“mybutton”).style Read more…

HTML text box should only accept numbers and dot

Author - Kailash

You can use the following javascript code to check textbox value:

<html>
<head>
<script language=”Javascript”>
function isNumberKey(evt)
{
var re=new RegExp(/^[0-9]*.?[0-9]*$/);
if(document.getElementById(“text”).value.match(re))
{
alert(“match”);
}
else
{
alert(“no match”);
return false;
}
}
</script Read more…

Javascript Calendar Problem on Chrome and Safari browsers

Author - Kritika Sood

While working in a project, we faced a problem with using a calendar on a webpage. It was working fine for Mozilla Firefox but not for Chrome and Safari.

Initially we had this code:

<input type=”text” name=”startdate” id=”startdate” class=”form-control datepicker” placeholder=”Financial Year StartDate Read more…

Java | Maven | How to pack Maven dependencies while creating jar file

Author - Rita

We were creating a Maven project having packaging type jar. We had main class from where we were starting project execution. It was working fine through Eclipse but when we created jar file by compiling with Maven, we were not able to run the jar as it was throwing missing Read more…

Salesforce | Fatal error: Uncaught SoapFault exception: [sf:REQUEST_LIMIT_EXCEEDED] REQUEST_LIMIT_EXCEEDED: TotalRequests Limit exceeded

Author - Kiran Preet

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 is basically the total number of API calls that Read more…

Eclipse | Generate client for RPC based web services

Author - Rita

1. Select your project where you want to generate client code for your wsdl file:

2. Select File -> new -> other option from drop down menu as shown below:

Select web service client option from the drop down and click on next button.

3. Add your Wsdl URL to Read more…

Heroku | What to do when dyno worker crashes

Author - Manju Kashyap
|
0 Comments
|

Problem: What to do when your dyno worker crashes (Heroku)?

Description: We were working on an application made on Heroku. Once our site was not opening and it was throwing “Application Error”. When we checked logs we saw following error description:

Error:  Jan 2016 12:47:56.278 2016-01 Read more…

Salesforce | Passing value of the variables from Visualforce page to the controller

Author - Webner
|
0 Comments
|

Problem : Accessing value of the variables on Visualforce page within the Controller.

Solution: We can access the value of the variables in the Controller of the Visualforce page by declaring the variables in Controller as public and get, set types like public type var1 {get;set;}

Example:

public class exampleContoller Read more…

How to add slow blur effect using jquery and css

Author - Neelam
|
0 Comments
|

Suppose you have to blur this image:

To show it like this and this blur effect should be gradual:

This is one solution to achieve this:

$(document).ready(function()
{
animationTime();
});

function slowblur(number)
{
$(‘#firstimage’).css({‘filter’:’blur(‘+number+’px)’,’-webkit-filter’: ‘blur(‘+number+’px)’,’-moz-filter’: ‘blur(‘+number+’px)’,
‘-o Read more…

‹ Prev page1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 Next page ›