- dlh2002
- Posts : 3
Join date : 2010-10-10
Can not check the checkbox on popup window
Mon Oct 11, 2010 8:13 am
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
Mon Oct 11, 2010 12:57 pm
selenium return 'OK', but the checkbox in UI actually did not be checked. does anyone know what happened?
- PriyankaRegular Participant
- Posts : 27
Join date : 2010-10-04
Try with selenium.check command
Mon Oct 11, 2010 1:39 pm
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...
- dlh2002
- Posts : 3
Join date : 2010-10-10
Re: Can not check the checkbox on popup window
Mon Oct 11, 2010 2:20 pm
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.
Permissions in this forum:
You cannot reply to topics in this forum
|
|