xpath - not able to select drop down in share point site using selenium webdriver -
below html code
<html dir="ltr" __expr-val-dir="ltr" xmlns:o="urn:schemas-microsoft-com:office:office"> <head> <body onload="javascript:if (typeof(_spbodyonloadwrapper) != 'undefined') _spbodyonloadwrapper();" scroll="yes"> <form id="aspnetform" onsubmit="javascript:return webform_onsubmit();" action="/lists/bedrifter/newform.aspx?rootfolder=%2flists %2fbedrifter&contenttypeid=0x010089708c9d4bd6934c8e5aad8ca5960372&source=http%3a%2f%2fbrbaker%2eiqubes%2ecom%2flists%2fbedrifter %2fallitems%2easpx" method="post" name="aspnetform"> <div> <script type="text/javascript"> <script type="text/javascript" src="/webresource.axd?d=4d6eozshmx02ommsche3dbhlrybv8g3rhgo1crqqdrnsnv0ocsltu- h2jr6npxursq6udfwcyi3o0djf_zfak3a8coa1&t=634605546709717464"> <script> <script language="javascript" type="text/javascript"> <script src="/_layouts/datepicker.js" language="javascript"> <script language="javascript"> <script language="javascript"> <script type="text/javascript"> <script type="text/javascript" src="/scriptresource.axd?d=lim-50lye1zdrlx4mmfl650slf8k9dodc77ca32d5iqccwzgc0o44-jdqvjwvdovfnhnh9rv8et6izprg0j0- hy3rwat6a8wzzydlichidueuv3em6jvmf-3rag4gzdt7vmtwa2&t=ffffffffe0ec361c"> <script type="text/javascript" src="/scriptresource.axd?d=kzc4qkzpw8vsuffzjozjbiuurcjh8hh4jceoz-as9sozhjrhyo0- qlxfsc_czdzwhipnmuwdugwdjjjuvkjpey6lu2n5nvmkbb5lpz-ym3gafcbkwp54a0try64gthczzoxjy1sdhjib8zf8ihnfyopgobe1&t=23ac280b"> <script type="text/javascript" src="/scriptresource.axd?d=glp6mnjf7a1dhb7t8aiwfln7lyijt8kl_ykq1264_-9qdu3y7jwhzhckumpfvlz3bluocpjtzgterzzfjqex- 7jeixozzewn1qsybhli3wdjou1cpd5txpfeu4or9shjqq-3zcdmbq-5nf6lo2fvf-osqgunrmwo8kwzbqn8gllp10qd0&t=23ac280b"> <script type="text/javascript" src="/webresource.axd?d=xyoo8lvwqo4vp8qzn5oau9znisutuo_7hemk_xb4mc0j5qxchkzygsqum- geshbbkear07gg56nkgpjwat9uisvxgys1&t=634605546709717464"> <script type="text/javascript"> <div> <script type="text/javascript"> <table class="ms-iqubes-body" width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td class="ms-globalbreadcrumb" colspan="4"> <td width="3%" valign="middle" style="padding-left:3px; padding-right:6px;"> </tr> </tbody> </table> </td> </tr> <tr> <tr> <tr height="100%"> <td> <table class="iqubes-background" width="100%" height="100%" cellspacing="0" cellpadding="0"> <tbody> <tr> <tr> <td id="leftnavigationareacell" class="ms-leftareacell" valign="top" height="100%"> <td> <td class="ms-bodyareacell" valign="top"> <placeholder id="ctl00_mso_contentdiv"> <table id="mso_contenttable" class="ms-propertysheet" width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td class="ms-bodyareaframe" valign="top" height="100%"> <a name="maincontent"></a> <script type="text/javascript" language="javascript"> <table id="onetidlistform" cellspacing="0" cellpadding="0"> <tbody> <tr> <td> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td id="msozonecell_webpartwpq5" valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0" toplevel=""> <tbody> <tr> <td valign="top"> <div id="webpartwpq5" style="" allowdelete="false" width="100%" haspers="false" webpartid="bac1b910-309d-4e46-47b4-0b8a052b0579"> <span id="part1"> <table id="ctl00_m_g_bac1b910_309d_4e46_47b4_0b8a052b0579_ctl00_toolbartbltop" class="ms-formtoolbar" width="100%" border="0" cellspacing="0" cellpadding="2"> <table id="ctl00_m_g_bac1b910_309d_4e46_47b4_0b8a052b0579_ctl00_ctl01_ctl00_toolbartbl" class="ms-toolbar" width="100%" border="0" cellspacing="0" cellpadding="2"> <table class="ms-formtable" width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-top: 8px;"> <tbody> <tr> <tr> <tr> <tr> <tr> <tr> <tr> <tr> <tr> <tr> <tr> <tr> <tr> <tr> <tr> <tr> <td class="ms-formlabel" width="190px" valign="top" nowrap="true"> <td class="ms-formbody" width="400px" valign="top"> <span dir="none"> <select id="ctl00_m_g_bac1b910_309d_4e46_47b4_0b8a052b0579_ctl00_ctl04_ctl15_ctl00_ctl00_ctl04_ctl00_lookup" title="parent company" name="ctl00$m $g_bac1b910_309d_4e46_47b4_0b8a052b0579$ctl00$ctl04$ctl15$ctl00$ctl00$ctl04$ctl00$lookup"> <br>
i used method's selecting drop down below
new select(driver.findelement(by.xpath("//*[@id='ctl00_m_g_bac1b910_309d_4e46_47b4_0b8a052b0579_ctl00_ctl04_ctl15_ctl00_ctl00_ctl04_ctl00_lookup']"))).selectbyvisibletext("baker brazil");
i tried id, name etc getting error
org.openqa.selenium.nosuchelementexception: unable find element xpath =="".
i using ie 10 testing of share point site.
just give try below locator.
new select(driver.findelemet(by.cssselector("select[title='parent company']"))).selectbyvisibletext("baker brazil");
Comments
Post a Comment