Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
15
WebDataGrid with Selenium
posted

I am trying to use C# and Selenium to read a page.using webDataGrid

The WebDataGrid in the page is defined as follows

<iggc:webdatagrid Id="grdAccountList" runat="server" AutoGenerateColumns="False" DataKeyFields="RowSequenceIndex">

   <columns>

    <iggc:BoundDataField key="ActPercent" DataFieldName ="ActPercent" Header-Text="Percent" DataType="System.Decimal" DataFormatString="{0:n2}" > </iggc:BoundDataField>

   </Columns>

<EditorProviders>

  <iggc:NumericEditorProvider ID="PercentProviderId">

   <EditorControl MaxDecimalPlaces="2" MaxValue="100" MinValue = "0"

<i/ggc:NumericEditorProvider >

</EditorProviders>

<Behaviors>

<iggc:Activation Enabled="true"></iggc:Activation>

<iggc:Selection CellClickAction="Row" RowSelectType="Single" Enabled="true"> </iggc:Selection>

<iggc:RowSelectors Enabled="true" RowNumbering="true"> </iggc:RowSelectors>

<iggc:EditingCore AutoCrud="false" Enabled="true"> </iggc:EditingCore>

<Behaviors>

<iggcLCellEditing Enabled="true" EditModeActions-MouseClick="Single" EditModeActions-EnableOnActive="true">

<ColumnSettings>

<iggc:EditingColumnSetting columnkey="ActPercent" EditorId="PercentProviderId">

</ColumnSettings>

</iggc:CellEditing>

</Behaviors>

</iggc:WebDataGrid>

The C# Selenium code is as follows

IJavaScriptExecutor js = (IJavaScriptExecutor)driver;

string js2 = "document.getElementById('grdAccountList').get_cell().get_index().set_Value(20);

js.Execute.Script(js2);

When I run the Selenium code , if fails with error "get_cell() function not found"

Parents
  • 15
    Offline posted

    I changed the C# Selenium code as follows

    string js2 = "$find('grdAccountList').get_rows().get_row(0).get_cell(2).set_value(33)"

    js.executeScript(js2)

    This works..

    But, below code (that should refresh html page) fails with error

    string webgridRefresh = "$find*'grdAccountList').RequestfullAsyncReder()"

    js.executeScript(webgridRefresj);

    The exception is $find(...).RequestfullAsyncRender is not a funciton

Reply Children