Can not check the checkbox on popup window
Page 1 of 1 • Share •
Can not check the checkbox on popup window
Dear All
I am using selenium with java. On the click on the hyperlink, a pop
window is displayed. I can click on the close button. But fail to
click the check box. the test case is:
selenium.click("link=Business Unit(s)");
selenium.waitForPopUp("test", "30000");
selenium.selectWindow("test"]);
selenium.click("xpath=(//INPUT[@type='checkbox'])[1]");
selenium.click("/FORM/DIV/SPAN/DIV[contains(text(),'CPI Asia')]/INPUT/
@type='checkbox'");
The result is:
16:31:31.531 INFO - Command request: click[xpath=(//
INPUT[@type='checkbox'])[1], ] on session
a5913960ad8544fa8221cd2667c3e3ff
16:31:33.015 INFO - Got result: OK on session
a5913960ad8544fa8221cd2667c3e3ff
16:31:33.015 INFO - Command request: click[/FORM/DIV/SPAN/
DIV[contains(text(),'CPI Asia')]/INPUT/@type='checkbox', ] on session
a5913960ad8544fa8221cd2667c3e3ff
16:31:34.093 INFO - Got result: ERROR: Element /FORM/DIV/SPAN/
DIV[contains(text(),'CPI Asia')]/INPUT/@type='checkbox' not found on
session a5913960ad8544fa8221cd2667c3e3ff
]]
The html source is(i got it using IE developer tool:
action="MultiTreeviewBottomFrame.aspx?
Sentinel=Sentinel&MaintainSpec=true&selectionType=checkBox&SelectedValuesScriptMethod=selectedBUValues&scriptMethod=SelectBUs&dataSource=Class
%3aXeno.Web.UI.DataSources.TaxonomyXNodeTreeViewDataSource
%2cXenoWebControls
%24GSMBusinessUnit&selectLeafOnly=False&rootNodesNotSelectable=false&selectionRequired=False&showHoverText=False"
method="post">
SPAN>
I am using selenium with java. On the click on the hyperlink, a pop
window is displayed. I can click on the close button. But fail to
click the check box. the test case is:
selenium.click("link=Business Unit(s)");
selenium.waitForPopUp("test", "30000");
selenium.selectWindow("test"]);
selenium.click("xpath=(//INPUT[@type='checkbox'])[1]");
selenium.click("/FORM/DIV/SPAN/DIV[contains(text(),'CPI Asia')]/INPUT/
@type='checkbox'");
The result is:
16:31:31.531 INFO - Command request: click[xpath=(//
INPUT[@type='checkbox'])[1], ] on session
a5913960ad8544fa8221cd2667c3e3ff
16:31:33.015 INFO - Got result: OK on session
a5913960ad8544fa8221cd2667c3e3ff
16:31:33.015 INFO - Command request: click[/FORM/DIV/SPAN/
DIV[contains(text(),'CPI Asia')]/INPUT/@type='checkbox', ] on session
a5913960ad8544fa8221cd2667c3e3ff
16:31:34.093 INFO - Got result: ERROR: Element /FORM/DIV/SPAN/
DIV[contains(text(),'CPI Asia')]/INPUT/@type='checkbox' not found on
session a5913960ad8544fa8221cd2667c3e3ff
]]
The html source is(i got it using IE developer tool:
action="MultiTreeviewBottomFrame.aspx?
Sentinel=Sentinel&MaintainSpec=true&selectionType=checkBox&SelectedValuesScriptMethod=selectedBUValues&scriptMethod=SelectBUs&dataSource=Class
%3aXeno.Web.UI.DataSources.TaxonomyXNodeTreeViewDataSource
%2cXenoWebControls
%24GSMBusinessUnit&selectLeafOnly=False&rootNodesNotSelectable=false&selectionRequired=False&showHoverText=False"
method="post">
id="droot"> id="21079a4ec66b-4024-4d4c-9dd7-1a3be69bffcc" style="TEXT-DECORATION:
underline">name="hidden21079a4ec66b-4024-4d4c-9dd7-1a3be69bffcc" value="CPI
Africa" />value="21079a4ec66b-4024-4d4c-9dd7-1a3be69bffcc" />CPI Africa
underline">name="hidden21079a4ec66b-4024-4d4c-9dd7-1a3be69bffcc" value="CPI
Africa" />value="21079a4ec66b-4024-4d4c-9dd7-1a3be69bffcc" />CPI Africa
SPAN>
Actually no checkbox was cliecked in UI side. Does anybody know how to resolve
it.
Thanks
Eric
dlh2002- Posts: 3
Join date: 2010-10-10
Re: Can not check the checkbox on popup window
selenium return 'OK', but the checkbox in UI actually did not be checked. does anyone know what happened?
dlh2002- Posts: 3
Join date: 2010-10-10
Try with selenium.check command
Hi,
Can u please try it with
selenium.check("id of checkBox"); instead of selenium.click("id of checkBox");
Please let me know the result...
Can u please try it with
selenium.check("id of checkBox"); instead of selenium.click("id of checkBox");
Please let me know the result...
Priyanka- Regular Participant

- Posts: 27
Join date: 2010-10-04
Re: Can not check the checkbox on popup window
Thanks Priyanka
I changed to
selenium.check("xpath=(//INPUT[@type='checkbox'])[1]");
selenium.ischeck("xpath=(//INPUT[@type='checkbox'])[1]");
selenium return 'OK' and 'true', but UI actually did not get checked.
I changed to
selenium.check("xpath=(//INPUT[@type='checkbox'])[1]");
selenium.ischeck("xpath=(//INPUT[@type='checkbox'])[1]");
selenium return 'OK' and 'true', but UI actually did not get checked.
dlh2002- Posts: 3
Join date: 2010-10-10
Similar topics» How to get focus to a new popup window which doesnt have name,id or unique title.
» Popup window for friends request
» Unable to identify the dynamic object(check box, drop down box,Pop-up window and status image)
» Can not check the checkbox on popup window
» Can't get the message from popup
» Popup window for friends request
» Unable to identify the dynamic object(check box, drop down box,Pop-up window and status image)
» Can not check the checkbox on popup window
» Can't get the message from popup
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
» sample webdriver code for php users
» which standalone server to use
» Dynamic Drop Down Selection
» It is possible to find list of all URL's exist in any web page in selenium ide
» It is possible to compare 2 same images in selenium IDE.
» how to compare 2 ULR's which is exist in same web page (View page source).
» Web Driver: Unable to click a link present inside the frame of a frameset
» Help me to get dynamicaly loaded options of dropdown in Selenium RC -Junit test case