Issues with Firefox / Gecko driver (Nov 2016)

I use protractor for automation. There have been issues with webdriver 2.x with FF 48.x and up. protractor does not yet support gecko driver.

I did  workaround mentioned here to enable firefox using gecko driver working with protractor.

This worked well but there are still many feature that are not implemented in gecko driver and seems like they are work in progress.

Here are couple that troubled me and their workaround.

Note: I defined a global variable (say BrowserType) that gets populated with the actual browser type using below code. This variable was used by code to decide when to use firefox specific workaround.

return browser.getCapabilities().then(function (cap){
    return  cap.get('browserName');
});

1. action builder:

Ex:

browser.actions().mouseMove(element).perform();

Errors:

POST /session/22243008-f8f8-4b66-b6b4-bd395994f8db/moveto did not match a known command

Suggested solution:

If you are using similar code to view a dropdown, please don’t spend any more time to solve it. It’s not yet implemented. Use javascript to directly click on the element that is supposed to be shown by mouse over.

Example:

browser.executeScript("arguments[0].click();", element);

2. Getting a attribute value from edit box

Ex:

 element.getAttribute('value');

Errors:

NULL value is returned instead of actual value

Suggested solution:

I could not make it work and finally I had to go back to direct javascript executor to solve this.

Example:

 browser.executeScript("return arguments[0].value", element);

If I hit more blocking issues, I’ll come back and update this page.
By the way,  Selenium 3.x beta is available and works well with webdriver. Though it did not work for me with protractor . If selenium 3.x has worked for you , that may be better option to use instead of above combination.

Advertisements

Protractor with Firefox using marionette driver

There have been various issues using selenium-standalone driver due to frequent update to Firefox.  It’s great to see marionette driver from Mozilla. It’s well documented at https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette  .

In this article, I have covered steps required to use it with protractor. Note that “Protractor” does not yet support Selenium-Standalone 3.x. Additionally, gecko version 0.8 is the max version that works with selenium-standalone jar 2.x

Steps:

  1. Download gecko driver from https://github.com/mozilla/geckodriver/releases/tag/v0.8.0
  2. Instead of using  webdriver-manager start, use below command
    java -jar /usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-2.53.1.jar -Dwebdriver.chrome.driver=/usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.22 -Dwebdriver.gecko.driver=/usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-0.8.0-OSX

3.  Add below lines in protractor.conf

capabilities: {
    'browserName': 'firefox',
    'marionette': true
  },

 

That’s it.  You are ready to use Marionette

 

 

–> Above solution solves most of the issue with Firefox 47.x 48.x / selenium-server-standalone-2.53.1.jar

–> It solves issues ike:

1- Firefox launches , but does not load the url

2. You get below exception

[22:41:07] E/launcher - Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
-a285-3208198ce6fd}","syncGUID":"qek8BxoYPz7q","location":"app-global","version":"48.0.2","type":"theme","internalName":"classic/1.0","updateURL":null,"updateKey":null,"optionsURL":null,"optionsType":null,"aboutURL":null,"icons":{"32":"icon.png","48":"icon.png"},"iconURL":null,"icon64URL":null,"defaultLocale":{"name":"Default","description":"The default theme.","creator":"Mozilla","homepageURL":null,"contributors":["Mozilla Contributors"]},"visible":true,"active":true,"userDisabled":false,"appDisabled":false,"descriptor":"/Applications/Firefox.app/Contents/Resources/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi","installDate":1473992361000,"updateDate":1473992361000,"applyBackgroundUpdates":1,"skinnable":true,"size":7140,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":false,"hasBinaryComponents":false,"strictCompatibility":true,"locales":[],"targetApplications":[{"id":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"48.0.2","maxVersion":"48.0.2"}],"targetPlatforms":[],"seen":true}
1474090822432    addons.xpi    DEBUG    getModTime: Recursive scan of {972ce4c6-7e08-4474-a285-3208198ce6fd}
1474090822433    DeferredSave.extensions.json    DEBUG    Save changes
1474090822433    addons.xpi    DEBUG    Updating database with changes to installed add-ons
1474090822433    addons.xpi-utils    DEBUG    Updating add-on states
1474090822433    addons.xpi-utils    DEBUG    Writing add-ons list
1474090822434    addons.xpi    DEBUG    Registering manifest for /Applications/Firefox.app/Contents/Resources/browser/features/e10srollout@mozilla.org.xpi
1474090822434    addons.xpi    DEBUG    Calling bootstrap method startup on e10srollout@mozilla.org version 1.1
1474090822434    addons.xpi    DEBUG    Registering manifest for /Applications/Firefox.app/Contents/Resources/browser/features/firefox@getpocket.com.xpi
1474090822435    addons.xpi    DEBUG    Calling bootstrap method startup on firefox@getpocket.com version 1.0.4
1474090822435    addons.xpi    DEBUG    Registering manifest for /Applications/Firefox.app/Contents/Resources/browser/features/loop@mozilla.org.xpi
1474090822436    addons.xpi    DEBUG    Calling bootstrap method startup on loop@mozilla.org version 1.4.4
1474090822451    addons.manager    DEBUG    Registering shutdown blocker for XPIProvider
1474090822451    addons.manager    DEBUG    Provider finished startup: XPIProvider
1474090822451    addons.manager    DEBUG    Starting provider: LightweightThemeManager
1474090822451    addons.manager    DEBUG    Registering shutdown blocker for LightweightThemeManager
1474090822452    addons.manager    DEBUG    Provider finished startup: LightweightThemeManager
1474090822452    addons.manager    DEBUG    Starting provider: GMPProvider
1474090822456    addons.manager    DEBUG    Registering shutdown blocker for GMPProvider
1474090822456    addons.manager    DEBUG    Provider finished startup: GMPProvider
1474090822456    addons.manager    DEBUG    Starting provider: PluginProvider
1474090822457    addons.manager    DEBUG    Registering shutdown blocker for PluginProvider
1474090822457    addons.manager    DEBUG    Provider finished startup: PluginProvider
1474090822457    addons.manager    DEBUG    Completed startup sequence
1474090822865    addons.manager    DEBUG    Starting provider: <unnamed-provider>
1474090822865    addons.manager    DEBUG    Registering shutdown blocker for <unnamed-provider>
1474090822865    addons.manager    DEBUG    Provider finished startup: <unnamed-provider>
1474090822867    DeferredSave.extensions.json    DEBUG    Starting write
1474090823067    addons.repository    DEBUG    No addons.json found.
1474090823068    DeferredSave.addons.json    DEBUG    Save changes
1474090823070    DeferredSave.addons.json    DEBUG    Starting timer
1474090823115    addons.manager    DEBUG    Starting provider: PreviousExperimentProvider
1474090823116    addons.manager    DEBUG    Registering shutdown blocker for PreviousExperimentProvider
1474090823116    addons.manager    DEBUG    Provider finished startup: PreviousExperimentProvider
1474090823119    DeferredSave.extensions.json    DEBUG    Write succeeded
1474090823120    addons.xpi-utils    DEBUG    XPI Database saved, setting schema version preference to 17
1474090823125    DeferredSave.addons.json    DEBUG    Starting write
1474090823150    DeferredSave.addons.json    DEBUG    Write succeeded

[22:41:07] E/launcher - WebDriverError: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
-a285-3208198ce6fd}","syncGUID":"qek8BxoYPz7q","location":"app-global","version":"48.0.2","type":"theme","internalName":"classic/1.0","updateURL":null,"updateKey":null,"optionsURL":null,"optionsType":null,"aboutURL":null,"icons":{"32":"icon.png","48":"icon.png"},"iconURL":null,"icon64URL":null,"defaultLocale":{"name":"Default","description":"The default theme.","creator":"Mozilla","homepageURL":null,"contributors":["Mozilla Contributors"]},"visible":true,"active":true,"userDisabled":false,"appDisabled":false,"descriptor":"/Applications/Firefox.app/Contents/Resources/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi","installDate":1473992361000,"updateDate":1473992361000,"applyBackgroundUpdates":1,"skinnable":true,"size":7140,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":false,"hasBinaryComponents":false,"strictCompatibility":true,"locales":[],"targetApplications":[{"id":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"48.0.2","maxVersion":"48.0.2"}],"targetPlatforms":[],"seen":true}
1474090822432    addons.xpi    DEBUG    getModTime: Recursive scan of {972ce4c6-7e08-4474-a285-3208198ce6fd}
1474090822433    DeferredSave.extensions.json    DEBUG    Save changes
1474090822433    addons.xpi    DEBUG    Updating database with changes to installed add-ons
1474090822433    addons.xpi-utils    DEBUG    Updating add-on states
1474090822433    addons.xpi-utils    DEBUG    Writing add-ons list
1474090822434    addons.xpi    DEBUG    Registering manifest for /Applications/Firefox.app/Contents/Resources/browser/features/e10srollout@mozilla.org.xpi
1474090822434    addons.xpi    DEBUG    Calling bootstrap method startup on e10srollout@mozilla.org version 1.1
1474090822434    addons.xpi    DEBUG    Registering manifest for /Applications/Firefox.app/Contents/Resources/browser/features/firefox@getpocket.com.xpi
1474090822435    addons.xpi    DEBUG    Calling bootstrap method startup on firefox@getpocket.com version 1.0.4
1474090822435    addons.xpi    DEBUG    Registering manifest for /Applications/Firefox.app/Contents/Resources/browser/features/loop@mozilla.org.xpi
1474090822436    addons.xpi    DEBUG    Calling bootstrap method startup on loop@mozilla.org version 1.4.4
1474090822451    addons.manager    DEBUG    Registering shutdown blocker for XPIProvider
1474090822451    addons.manager    DEBUG    Provider finished startup: XPIProvider
1474090822451    addons.manager    DEBUG    Starting provider: LightweightThemeManager
1474090822451    addons.manager    DEBUG    Registering shutdown blocker for LightweightThemeManager
1474090822452    addons.manager    DEBUG    Provider finished startup: LightweightThemeManager
1474090822452    addons.manager    DEBUG    Starting provider: GMPProvider
1474090822456    addons.manager    DEBUG    Registering shutdown blocker for GMPProvider
1474090822456    addons.manager    DEBUG    Provider finished startup: GMPProvider
1474090822456    addons.manager    DEBUG    Starting provider: PluginProvider
1474090822457    addons.manager    DEBUG    Registering shutdown blocker for PluginProvider
1474090822457    addons.manager    DEBUG    Provider finished startup: PluginProvider
1474090822457    addons.manager    DEBUG    Completed startup sequence
1474090822865    addons.manager    DEBUG    Starting provider: <unnamed-provider>
1474090822865    addons.manager    DEBUG    Registering shutdown blocker for <unnamed-provider>
1474090822865    addons.manager    DEBUG    Provider finished startup: <unnamed-provider>
1474090822867    DeferredSave.extensions.json    DEBUG    Starting write
1474090823067    addons.repository    DEBUG    No addons.json found.
1474090823068    DeferredSave.addons.json    DEBUG    Save changes
1474090823070    DeferredSave.addons.json    DEBUG    Starting timer
1474090823115    addons.manager    DEBUG    Starting provider: PreviousExperimentProvider
1474090823116    addons.manager    DEBUG    Registering shutdown blocker for PreviousExperimentProvider
1474090823116    addons.manager    DEBUG    Provider finished startup: PreviousExperimentProvider
1474090823119    DeferredSave.extensions.json    DEBUG    Write succeeded
1474090823120    addons.xpi-utils    DEBUG    XPI Database saved, setting schema version preference to 17
1474090823125    DeferredSave.addons.json    DEBUG    Starting write
1474090823150    DeferredSave.addons.json    DEBUG    Write succeeded

    at WebDriverError (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:27:10)
    at Object.checkLegacyResponse (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:639:15)
    at parseHttpResponse (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:538:13)
    at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:472:11
    at ManagedPromise.invokeCallback_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1379:14)
    at TaskQueue.execute_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2913:14)
    at TaskQueue.executeNext_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2896:21)
    at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2820:25
    at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:639:7
    at process._tickCallback (node.js:368:9)
From: Task: WebDriver.createSession()
    at Function.createSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:329:24)
    at Builder.build (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/builder.js:458:24)
    at Hosted.DriverProvider.getNewDriver (/usr/local/lib/node_modules/protractor/built/driverProviders/driverProvider.js:37:33)
    at Runner.createBrowser (/usr/local/lib/node_modules/protractor/built/runner.js:190:43)
    at /usr/local/lib/node_modules/protractor/built/runner.js:264:30
    at _fulfilled (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:834:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:863:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:796:13)
    at /usr/local/lib/node_modules/protractor/node_modules/q/q.js:556:49
    at runSingle (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:137:13)
[22:41:07] E/launcher - Process exited with error code 199

 

 

Approach to Automation of firefox and Chrome extensions using Selenium

Browser extensions does not use browser space for it’s GUI display and user interaction, this making it impossible to automate it through Selenium.

But, fortunately, you can run the extension in browser space with little trick and with that you can automate it using Selenium

Below steps will help you do exactly same for a Chrome extension called packman ( https://chrome.google.com/webstore/detail/pacman/palgcoflnoaklkflllnmheiollkgkipm)

Steps:

Way 1:

1.  go to Extension location on the disk . In case of Mac , it’s ~//Library/Application Support/Google/Chrome/Default/Extensions

2. You can find all the extension (installed) here, you can go to folder “palgcoflnoaklkflllnmheiollkgkipm”

palgcoflnoaklkflllnmheiollkgkipm can be found in the Chrome webstore URL

3. find all the html file under this folder. In most cases, you’ll find only one. ( You can use command like find . -name *html ). In case of Packman, you will find  –> ./1.26_0/popup.html

4. Access Pacman in browser interface

Type below in your Chrome Location bar:  chrome-extension://palgcoflnoaklkflllnmheiollkgkipm/popup.html

You can access packman in your browser i.e. You can automate them using Selenium.

On Firefox, the URL will be

chrome://pacman/content/pacman.xul

You can refer to below file to find the URL :

~/Library/Application\ Support/Firefox/Profiles/<profileName>/extensions/pacman\@oppermann.ch.xpi

However, there are some trick involved when it comes to automating it with Selenium. I’ll cover steps for doing it with Java/Python on Firefox and Chrome in next blog.

LDIF Examples : Add modify and Delete users (inetorgperson)

LDIF : Light weight Data Interchange format.

Please go through https://www.ietf.org/rfc/rfc2849.txt for reference

 

Case:  Add an entry to any LDAP Server. (Ex: InetOrgPerson)

Steps: Read the objectclass definition for the entry .

Must attributes for InetOrgPerson: CN (Common Name) and SN  (Surname)

Naming Attribute: UID / CN i.e. RDN (Relative Distinguished Name) can be CN or, UID.

Optional Attributes: Many ( Additionally all the attributes deifined in objectclasses which are used to derive InetOrgperson is available too)

 

Ex:  Adding a sample user “bob” under organization “troubleshoot:


dn: cn=bob,o=troubleshoot
changetype: add
objectclass: inetOrgPerson
cn: bob
sn: test
userpassword: sdh^@hg(^3
title: Test User
TelephoneNumber: 555 555 6666
mail: bob@troubleshoot.com

Ex: Adding additional attributes “UID” and country to entry “bob”


dn: cn=bob,o=troubleshoot
changetype: modify
add: uid
uid: bob-uid
-
add: c
c:UD

Ex: Adding one more value for mail


dn: cn=bob,o=troubleshoot
changetype: modify
add: mail
mail: newmailid@troubleshoot.com

Ex: Replacing all previous values of mail with a new one.


dn: cn=bob,o=troubleshoot
changetype: modify
replace: mail
mail: finalmail@troubleshoot.com

Ex: Delete title


dn: cn=bob,o=troubleshoot
changetype: modify
delete: title

Ex: Delete entry bob


dn: cn=bob,o=troubleshoot
changetype: delete

Let me know through comment if you need example for any of below or, you have any other question….. I’ll update the post with response asap…

Ex: Change RDN

Ex: Alias

Ex: Add to a group

Ex:

Lightweight Directory Access protocol ( LDAP ) : Basic layman style introduction

LDAP – Lightweight Directory Access Protocol

Basic:

 Think of it as a Tree… “Say Apple tree” . It has leaves , Apple etc..,

Apple has property like Cover, color, seeds etc.

Similarly, Leave has properties like It’s Green , It’s soft etc….

Let’s look closely @ Apple,

We can view Apple as “class” in java and it’s occurrence in the tree as instances of Apple Object…. –> In LDAP, it’s exactly same, Apple is ObjectClass and Instances of it on tree are called Objects or. entries.

Properties of Apple ..Color , Cover , Seeds are property that defines Apple… in LDAP , These can be viewed as attribute that defined the  Objectclass “Apple”.

Similarly you can think of other entries on Apple Tree ..i.e. Leaves , stem etc.

 Now, coming back to LDAP, LDAP is a Database which holds data like any other database, but in Hierarchically fashion and are defined by Objectclasses.

The data/objects could be user , Computer, Server, Customer and everything that needs to be represented as data.

Ex: One of the popular used object class is “user” in Active Directory.

     If you look into the schema, it is defined as an object class which must hold attributes like “CN (common Name)” and SN (surname) . It may additionally hold attribute like UID, UserPassword,photo , member (group membership) , title, Supervisor, etc.

Schema , which defines ldapSyntax, Attribute, Objectlass and extensions , are key which defines the data that is stored in an LDAP Server along with access capabilities. We’ll take deep dive into them later.

Below is Sample LDIF file to create a user in LDAP.

 ——————–

dn: cn=user1,cn=users,dc=domainname,dc=com

change type: Add

Objectclass: inetOrgperson

sn: user1

userpassword: password

uid: user1

——————-

Aero-planes

Hello, this a blog about aero-planes. I recommend you read this no matter what your knowledge is about the Flying Machines.

 World War II

Changes

The big change in the making of the great Flying Machines happened in WWII. Some changes were that the propellers changed from fan to jet. They also changed from this :

 

to this:

 

and this:

Planes made

Click on the following link to arrive at a wikipedia page to see list of all the planes that were made:

 

 

 

 

How to create a Self Signed Certificate : x509 / P12 : using OpenSSL

Make sure that you have openssl package on your system. You can download it from http://openssl.com/download.html

Execute Below command:


   openssl req -new -x509 -nodes -out certificate.crt -keyout certificate.key


Example:

openssl req -new -x509 -nodes -out certificate.crt -keyout certificate.key

Generating a 1024 bit RSA private key

……………..++++++

……………++++++

writing new private key to ‘server.key’

—–

You are about to be asked to enter information that will be incorporated

into your certificate request.

What you are about to enter is what is called a Distinguished Name or a DN.

There are quite a few fields but you can leave some blank

For some fields there will be a default value,

If you enter ‘.’, the field will be left blank.

—–

Country Name (2 letter code) [AU]:US

State or Province Name (full name) [Some-State]:California

Locality Name (eg, city) []:San Francisco

Organization Name (eg, company) [Internet Widgits Pty Ltd]:TroubleShoot

Organizational Unit Name (eg, section) []:SSL

Common Name (e.g. server FQDN or YOUR name) []:ServerName.DomainName

Email Address []:troubleshoot@wordpress.com

This will generate certificate.crt (certificate file) and certificate.key (key file)

if you want to Create a P12 (Certificate and key in same file) , run below command:

openssl pkcs12 -export -out certificate.p12 -inkey certificate.key -in certificate.crt

Chrome on Windows : Automatic Client Certificate selection while using Selenium

To avoid the browser prompt for certificate selection (which requires code outside of Selenium like autoIt/Sikuli)

1. Import the certificate to Windows CAPI

a. You can use IE to import the certificate and store it in in “My Certificate” tab.

or, b. You can use below command to import the certificate

“certutil -f -user -p <password>  -importpfx <certificate>”

If you are automating the flow and may want to delete older certificate , You can use bolo code written in Java

String allCerts = execCommand.runCommand(“certutil -store -user My”);

List<String> CN = new ArrayList<String>();

int a = allCerts.indexOf(“, CN=”);

int b = allCerts.lastIndexOf(“, CN=”);

int c = allCerts.indexOf(” Non-root Certificate”);

int l = 0;

while( a <= b && a!=-1){

CN.add(allCerts.substring(a+5,c ));

String delCerts = execCommand.runCommand(“certutil -delstore -user My \”” + CN.get(l) + “\””);

log.info(“Deleting “ + CN.get(l) + ” : “ + delCerts);

l++;

a = allCerts.indexOf(“, CN=”,i+1);

c = allCerts.indexOf(” Non-root Certificate”,c+1);

}}

2. To let Chrome automatically select the certificate automatically:

Edit registry entry:  (If it does not exist, create it )

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\AutoSelectCertificateForUrls

Add Key: 1

Value: {{“pattern”:”[*.]abhay.com”,”filter”:{“ISSUER”:{“CN”:”ABHAY_ISSUER”}}}}

–> with above content, a certificate issued from CA “ABHAY_ISSUER” will automatically get selected when user access <any>.abhay.com

Chrome on Mac /OSX: Automatic Client Certificate selection while using Selenium

To avoid the browser prompt for certificate selection (which requires code outside of Selenium like autoIt/Sikuli)

1. Import the certificate to keyChain

Import the client certificate into keychain. Open the certificate detail –> Go to Trust section –> Select  “Always trust” for  “When using this certificate”

You can do this with command line utility as well:

security import   /<certDir>/certificate   -k  + ~/Library/Keychains/login.keychain  + ” -P ” + <password>;

2. To let Chrome automatically select the certificate automatically:

Create or Edit file “/Library/Preferences/com.google.Chrome.plist” :

<plist version=”1.0″>

<dict>

<key>AutoSelectCertificateForUrls</key>

<array>

<string>{“pattern”:”[*.]abhay.com”,”filter”:{“ISSUER”:{“CN”:”ABHAY_ISSUER”}}}</string>

</array>

</dict>

</plist>

–> with above content, a certificate issued from CA “ABHAY_ISSUER” will automatically get selected when user access <any>.abhay.com

Basic LDAP Search Filters – 2

LDAP Search Command: ldapsearch -h <LDAPHost> -p <Port> -D <Bind DN> -w <Bind DN password> -b <Base DN> -s <Scope>  <LDAP Search Filter>

Ex: ldapsearch -h 192.168.1.2 -p 389 -D cn=admin,o=novell -w password -b o=novell -s sub cn=brown

Below example are with attribute CN. But, You can use it with any attribute

1. AND condition (&)

  (&(CN=brown)(SN=mike))   ==> returns all the entries which has attribute CN as “brown” (case insensitive search) and SN as “mike”

  (&(cn=brown)(SN=mike)(zipcode=123456))  ==>  returns all the entries which has attribute CN as “brown” (case insensitive search) , SN as “mike” and zip code as “123456”

2. OR condition  (|)

  (|(CN=brown)(SN=mike)) ==> returns all the entries which has attribute CN as “brown”  or,  SN as “mike”

3. Complex – AND and OR

  (&(|(CN=Michael)(CN=mike))(SN=brown))  ==> returns all the entries which has attribute CN as Michael or, Mike and SN as Brown.

4. FDN in search

  to search group membership, you may use below filter:

  Novell eDirectory:

   (&(cn=mike)(groupmembership=”cn=groupofDirectors, ou=groups, o=company))  ==> this will return any entry whose CN is Mike and is member of group ” groupmembership=”cn=groupofDirectors, ou=groups, o=company”