0

I am trying to automate login page with the help of data driven testing by excel reading but it's throwing the error. kindly help me. enter image description here

*** Settings ***

Library           SeleniumLibrary

Resource    ../Resources/Login_resources.robot

Library   DataDriver  ../TestData/DDTXLS.xlsx    encoding="ISO-8859-1"

   
Library  String
      
Suite Setup  Login_resources.Start TestCase

Suite Teardown   Login_resources.Finish TestCase

Test Template   Invalid login


*** Test Cases *** 
Tc  1  3         
#Login with user    ${username}     ${password}   
   
       


*** Keywords ***

Invalid login
  
       [Arguments]         ${username}     ${password} 
   
       Input username      ${username}

       Input pass      ${password}

       Click login button

Login_resources.robot

*** Settings ***

Library      SeleniumLibrary

*** Variables ***
 
${LOGIN URL}        http://localhost:8100/

${Browser}      chrome


*** Keywords ***

Start TestCase 
    
   Set Selenium Implicit Wait    2s

    Open Browser            ${LOGIN URL}       ${Browser}

    maximize browser window

    Select frame  removeframe

    Sleep  2
    
Finish TestCase

        close all browsers

Open login page

        go to       ${LOGIN URL}

Input username

  [Arguments]     ${username}

        input text      xpath://*[@id="content"]/app-login/div[1]/div[2]/div[2]/div/form/div[1]/input      ${username}

Input pass

        [Arguments]     ${password}

        input text      xpath://*[@id="content"]/app-login/div[1]/div[2]/div[2]/div/form/div[2]/input     ${password}

Click login button

        click element    xpath://*[@id="content"]/app-login/div[1]/div[2]/div[2]/div/form/div[4]/a

Output::

  [ ERROR ] Calling method '_start_suite' of listener 'DataDriver' failed: SyntaxError: First column is not "*** Test Cases ***". This Column is mandatory.   
9
  • As a draft guess: Try to remove the leading space in the test case row ` Tc 1 3`. It probably adds additional empty column. Commented Nov 2, 2023 at 12:10
  • I tried this but Issue is not with this. Commented Nov 2, 2023 at 13:30
  • You'd probably want to format this question better too... Commented Nov 2, 2023 at 15:11
  • I am getting below error message even i am already declared the test cases in the excel sheet. "[ ERROR ] Calling method '_start_suite' of listener 'DataDriver' failed: SyntaxError: First column is not "*** Test Cases ***". This Column is mandatory. " Commented Nov 3, 2023 at 6:35
  • something is missing in the excel sheet that's why it's showing this error but i dont know what is exactly missing Commented Nov 6, 2023 at 8:07

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.