please solve my problem,, select2

156 views
Skip to first unread message

hak...@recruitbpm.com

unread,
Jun 30, 2016, 5:23:33 AM6/30/16
to Selenium Users
 

I found myself in a trouble when i wanted to test (searchable dropdown) that was implemented by select2.





this is error show in console of eclipse 

Exception in thread "main" org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"xpath","selector":".//*[@id='select2-company_id-container']"}
  (Session info: chrome=52.0.2743.49)
  (Driver info: chromedriver=2.22.397933 (1cab651507b88dec79b2b2a22d1943c01833cc1b),platform=Windows NT 10.0.10240 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 277 milliseconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 16:57:40'
System info: host: 'Niazi', ip: '192.168.1.128', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_91'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, chrome={chromedriverVersion=2.22.397933 (1cab651507b88dec79b2b2a22d1943c01833cc1b), userDataDir=C:\Users\HASEEB~1\AppData\Local\Temp\scoped_dir5880_17227}, takesHeapSnapshot=true, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=52.0.2743.49, platform=XP, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 21a5a48e679dfc318f4172079011f02f
*** Element info: {Using=xpath, value=.//*[@id='select2-company_id-container']}
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)




I have also attached the screenshot of the firebug element inspect and GUI


Process.
Click on drop down>Send keyword that will b searched>select result 


Hope you will help me
Thank you
Best Regards,
Haseeb Akram Khan
Junior QA Analyst
html.png
Untitled.png

Xiang Dong

unread,
Jun 30, 2016, 7:51:19 AM6/30/16
to Selenium Users
Is it in a iframe? Looks your locator is right. Copy all your html may help.

Best Regards,
David

From: seleniu...@googlegroups.com <seleniu...@googlegroups.com> on behalf of hak...@recruitbpm.com <hak...@recruitbpm.com>
Sent: Thursday, June 30, 2016 5:23:33 PM
To: Selenium Users
Subject: [selenium-users] please solve my problem,, select2
 
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/05a752b1-cdad-4ca5-a929-10a64cb5cb07%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

hak...@recruitbpm.com

unread,
Jul 4, 2016, 4:37:36 AM7/4/16
to Selenium Users
Thankyou for your response.
 
I am sending you html file.. at the bottom there is add company searchable drop down field. 
Due to Select2 i am unable to even click on the searchable drop down field through java selenium commands.
On clicking on the company field ==> search field opens ==> entering data in to the search field==> opens the drop down matching companies name from the database. the click on the name in the drop down to complete process


i dont have much experience thats why em stuck .  
a.htm
bootstrap-switch.css
bootstrap-switch.js
bootstrap-tagsinput.css
bootstrap-tagsinput.js
bootstrap-timepicker.css
bootstrap-timepicker.js
bootstrap-wizard.js
checkbox-radio-switch.css
ckeditor.js
config.js
animate.css
custom.css
daterangepicker.css
daterangepicker.js
editor_gecko.css
en.js
female-img.jpg
forms.js
fullcalendar.js
guage.js
jquery.css
bootstrap.js
jquery.js
jquery_002.css
jquery_002.js
jquery_003.css
jquery_003.js
jquery_004.js
jquery_005.js
jquery_006.js
jquery_007.js
jquery_008.js
bootstrap-editable.css
jquery_009.js
jquery_010.js
jquery-1.js
jquery-ui.js
js-development.js
moment.js
morris.js
multistep.css
odometer.js
odometer-theme-default.css
bootstrap-editable.js
pnotify.css
pnotify.js
raphael-2.js
rbpm-logo.png
select2.css
select2.js
skin.js
star-rating.css
style.css
styles.js
bootstrap-fileupload.css
contents.css
RecruitBPM.htm
bootstrap-fileupload.js
bootstrap-multiselect.css
bootstrap-multiselect.js

hak...@recruitbpm.com

unread,
Jul 4, 2016, 4:38:56 AM7/4/16
to Selenium Users

its RecruitBPM.html
Reply all
Reply to author
Forward
0 new messages