Read data from excel in selenium webdriver c#

Поділитися
Вставка

КОМЕНТАРІ •

  • @manoshkv
    @manoshkv 3 місяці тому

    I am getting the following Error CS0021 Cannot apply indexing with [] to an expression of type 'object' please assist me.

  • @sayedquader1212
    @sayedquader1212 2 роки тому

    Could you please make a vedio on how to automate Power bi ui report using selenium c#

  • @sainiranjan40
    @sainiranjan40 4 роки тому

    As I run on local I have no issues but when I upload to Azure DevOps (CI/CD) and run remotely, build failed with below errors. I was wondering why Azure DevOps failing to download the packages? Any suggestion please!
    [INFO] Compiling 32 source files to d:\a\1\s\ExceleRATE\target\classes
    [INFO] -------------------------------------------------------------
    [ERROR] COMPILATION ERROR :
    [INFO] -------------------------------------------------------------
    [ERROR] /e:/a/1/s/ExceleRATE/src/main/java/com/qa/ExceleRATE/util/ReadExcelData.java:[8,35] package org.apache.poi.ss.usermodel does not exist
    [ERROR] /e:/a/1/s/ExceleRATE/src/main/java/com/qa/ExceleRATE/util/ReadExcelData.java:[9,37] package org.apache.poi.xssf.usermodel does not exist
    [ERROR] /e:/a/1/s/ExceleRATE/src/main/java/com/qa/ExceleRATE/util/ReadExcelData.java:[10,37] package org.apache.poi.xssf.usermodel does not exist
    [ERROR] /e:/a/1/s/ExceleRATE/src/main/java/com/qa/ExceleRATE/util/ReadExcelData.java:[18,9] cannot find symbol
    symbol: class XSSFWorkbook
    location: class com.qa.ExceleRATE.util.ReadExcelData
    [ERROR] /e:/a/1/s/ExceleRATE/src/main/java/com/qa/ExceleRATE/util/ReadExcelData.java:[20,9] cannot find symbol
    symbol: class XSSFSheet
    location: class com.qa.ExceleRATE.util.ReadExcelData
    [ERROR] /e:/a/1/s/ExceleRATE/src/main/java/com/qa/ExceleRATE/util/ReadExcelData.java:[31,34] cannot find symbol
    symbol: class XSSFWorkbook
    location: class com.qa.ExceleRATE.util.ReadExcelData
    [INFO] 6 errors

    • @sharadranajava
      @sharadranajava 4 роки тому

      "ReadExcelData.java " Why it is calling Java ?

    • @sainiranjan40
      @sainiranjan40 4 роки тому

      @@sharadranajava I created seperate java class called ReadExcelData.java where I read my data from excel,
      public String getCellDataString(String sheetName, int rowNum, int colNum) throws IOException {
      File file = new File(System.getProperty("user.dir")+"/excel/ExcelWorkBook.xlsx");
      FileInputStream fis = new FileInputStream(file);
      wb = new XSSFWorkbook(fis);
      sheet = wb.getSheet(sheetName);
      String cellData = sheet.getRow(rowNum).getCell(colNum).getStringCellValue();
      return cellData;
      }

  • @annelinevandermerwe5035
    @annelinevandermerwe5035 4 роки тому

    I am getting the following errors...Can you please assist
    excel._Worksheet x1worksheet = x1workbook.Sheets[1]; - Gives me an error which states that I must use: excel._Worksheet x1worksheet = (excel._Worksheet)x1workbook.Sheets[1];
    website = x1range.Cells[i][1].value2; - Severity Code Description Project File Line Suppression State
    , Error CS0021 Cannot apply indexing with [] to an expression of type 'object' ReadDatafromFile ........repos\ReadDatafromFile\ReadDatafromFile\Program.cs 21 Active

  • @manojchowdary5085
    @manojchowdary5085 7 років тому

    I am getting exception "Excel cannot access 'ExcelData'. The document may be read-only or encrypted." i Checked the excel file it is not in read only mode.I just created a simple excel sheet with two columns.

  • @mklles
    @mklles Рік тому

    Hi I'm getting error >
    Cannot apply indexing with [] to an expression of type 'object' for line website= x1range.Cells[i][1].value2;
    please help, thank you TTTT

  • @amruthau4052
    @amruthau4052 7 років тому

    I'm getting this error : Error 1 A field initializer cannot reference the non-static field, method, or property 'UIL.UIL_Login.x1app'

  • @ganikarthiksaragada7985
    @ganikarthiksaragada7985 4 роки тому

    Excel.Application....
    It says this Application is not in microsoft.office.interop..
    What refrence I should add

  • @shadabshaikh6276
    @shadabshaikh6276 5 років тому

    I'm getting an error saying "Cannot implicitly convert type 'object ' to Microsoft.office.interop.excel._worksheet"

    • @rasheedsds
      @rasheedsds 4 роки тому

      I am getting an error saying "cannot implicitly convert type'object' to Microsoft.office.interop.excel._worksheet".. please reply

    • @miloplayz5264
      @miloplayz5264 3 роки тому

      excel._Worksheet x1_worksheet = (Microsoft.Office.Interop.Excel.Worksheet)x1workbook.Sheets[1];

  • @ashokreddypothureddy
    @ashokreddypothureddy 7 років тому

    i am getting Error like
    "starting chromeDriver 2.27.440174(e97a722caffc..............) on
    Port 7660
    Only local connections are allowed.
    starting chromeDriver 2.27.440174(e97a722caffc..............) on
    port 7754
    only local connections are allowed."
    my chrome opened 2 times and closed, but in url bar it showing like "data" instead of urls what is mentioned in excel sheet
    please tell me how to solve..

    • @Tutor4ever
      @Tutor4ever  7 років тому

      Hi Ashok,
      The data appears in the url bar if you have not appended the website url with ""
      Example: try using www.google.com instead of www.google.com

    • @ashokreddypothureddy
      @ashokreddypothureddy 7 років тому

      wow., Awesome
      now working as Expected
      Thank you
      and please make a video about instead of taking urls from excel sheet. system have a to take input data(name, address, ph number, email) from excel sheet and enter that data in respective fields like text boxes.
      i am requesting you.

    • @Tutor4ever
      @Tutor4ever  7 років тому +1

      Sure Ashok.
      Meanwhile to retrieve the value of a particular cell all you need to do is replace column and row value appropriately in the statement
      x1range.cells[row index][column index].Value2;

  • @SabbirHossain-yx9bl
    @SabbirHossain-yx9bl 6 років тому

    System.InvalidCastException: 'Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Excel.Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{000208D5-0000-0000-C000-000000000046}'
    I am getting this error on first line --> Microsoft.Office.Interop.Excel.Application x1app = new Microsoft.Office.Interop.Excel.Application();

  • @mduduzinonkwelo6750
    @mduduzinonkwelo6750 4 роки тому

    please create a video of reading two columns. username and password for instance.

  • @MrPupun
    @MrPupun 7 років тому

    Hi , I am getting the below error
    CS0656 Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.Binder.Convert' .
    Can anyone help me how to fix this issue

    • @YearOfTheCanine
      @YearOfTheCanine 6 років тому

      I know that I'm "late to the party", but in case anyone else has the same problem I will leave the solution here: You need to get "Microsoft.CSharp" and you get it the same way Tutor got the "Microsoft.Office.Interop.Excel".

    • @Tutor4ever
      @Tutor4ever  6 років тому

      Thanks cikarin3 :)

  • @ajayms2163
    @ajayms2163 7 років тому

    Error 1 One or more types required to compile a dynamic expression cannot be found. Are you missing a reference?
    what type error is this?

    • @Tutor4ever
      @Tutor4ever  7 років тому +1

      Hi Ajay,
      Try removing the "Microsoft.Csharp" reference then add it back to your project.
      Also ensure that you have added selenium package to your solution.

    • @ajayms2163
      @ajayms2163 7 років тому

      yes got it
      Thank you

  • @puthalGurudas
    @puthalGurudas 8 років тому

    showing error as
    An unhandled exception of type 'System.InvalidCastException' occurred in DataDriven.exe
    Additional information: Unable to cast COM object of type 'Microsoft.Office.Interop.Excel.ApplicationClass' to interface type 'Microsoft.Office.Interop.Excel._Application'.

    • @Tutor4ever
      @Tutor4ever  8 років тому +1

      It would be great if you share the statement where this error is occurring!
      Ensure that you have installed OpenQA.Selenium package to your current solution and also ensure that there is no case sensitivity issue.
      To know more about the code you could visit
      automation-tutorial.blogspot.in/2016/09/read-data-from-excel-sheet-for-webdriver.html?

  • @jhonnyrojas
    @jhonnyrojas 6 років тому

    Please need your help This video is very good and easy to understand. but if they have numbers in excel they appear an error: 'You can not implicitly convert the type 'double' to 'string'. ' what can i do? thks my friend

    • @Tutor4ever
      @Tutor4ever  6 років тому

      Hi Jhonny,
      Have you tried the below flow?
      1)Read data from cell
      2)store in a variable
      3)convert to double using Convert.ToDouble() method

    • @anjubhat1
      @anjubhat1 3 роки тому

      @@Tutor4ever correct me if i'm wrong technically, even i was facing the abv issue when added mobile number in the excel (as a user name) then i added ' (single quotation) before the mobile number in the excel & run my code .. then the issue got resolved .

  • @deiveegarajang
    @deiveegarajang 5 років тому

    What is the reference for this operation?

  • @sweatingmoves
    @sweatingmoves 7 років тому

    I am getting this error -
    System.Runtime.InteropServices.COMException : Exception from HRESULT: 0x800A03EC

    • @younasrehman8979
      @younasrehman8979 2 роки тому

      start from non-zero based indexing like start from 1 instead of zero

  • @LetCode96666
    @LetCode96666 6 років тому

    How do i write the result after finishing a test ?

    • @Tutor4ever
      @Tutor4ever  6 років тому

      Hi Shahriar,
      where do you want to write the result?

  • @mustafaar8152
    @mustafaar8152 3 роки тому

    Thanks 👍

  • @sachiienraut
    @sachiienraut 5 років тому

    Make video on 2 rows and 2 columns

  • @FunAndCreativeCorner
    @FunAndCreativeCorner 4 роки тому

    Thank you

  • @mohankrishna9232
    @mohankrishna9232 7 років тому

    Thank you so much

  • @Sajgoniarz
    @Sajgoniarz 4 роки тому

    Title suggest totally different topic...

  • @annelinevandermerwe5035
    @annelinevandermerwe5035 4 роки тому

    I am getting the following errors...Can you please assist
    excel._Worksheet x1worksheet = x1workbook.Sheets[1]; - Gives me an error which states that I must use: excel._Worksheet x1worksheet = (excel._Worksheet)x1workbook.Sheets[1];
    website = x1range.Cells[i][1].value2; - Severity Code Description Project File Line Suppression State
    , Error CS0021 Cannot apply indexing with [] to an expression of type 'object' ReadDatafromFile ........repos\ReadDatafromFile\ReadDatafromFile\Program.cs 21