Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to click login button #8295

Open
AmolForAll opened this issue Oct 9, 2024 · 1 comment
Open

Failed to click login button #8295

AmolForAll opened this issue Oct 9, 2024 · 1 comment
Labels
STATE: Need clarification An issue lacks information for further research. STATE: Need simple sample A simple sample is required to examine the issue. TYPE: bug The described behavior is considered as wrong (bug).

Comments

@AmolForAll
Copy link

What is your Scenario?

In our login test case, the script successfully enters the Username and Password, and it clicks the Login button, but it does not navigate to the next page (Looks just like its hovering over the button) . As a result, the next test fails due to the absence of the expected locator in the DOM

What is the Current behavior?

In our login test case, the script successfully enters the Username and Password, and it clicks the Login button, but it does not navigate to the next page (Looks just like its hovering over the button) . As a result, the next test fails due to the absence of the expected locator in the DOM

What is the Expected behavior?

It should click and navigate to next page so that other tests get appropriate locators over the DOM

What is the public URL of the test page? (attach your complete example)

Not Public Yet

What is your TestCafe test code?

await new action.Click({
testControl: t,
options: {
mappings: mappings,
language: language,
category: 'Login',
action: 'click',
data: 'Login'
}
}).execute();

Your complete configuration file

import action from './action';

const actionList = {
CLICK: action.Click,
DOUBLECLICK: action.Click,
NAVIGATETOMENU: action.NavigateToMenu,
TYPETEXT: action.TypeText,
APPENDTEXT: action.TypeText,
ASSERT: action.Assert,
BACK: action.NextBack,
NEXT: action.NextBack,
SCROLL: action.Scroll,
CONDITIONALCLICK: action.ConditionalClick,
READVALUE: action.ReadValue,
PRESSKEY: action.PressKey,
UPLOAD: action.Upload,
DRAG: action.DragToElement,
WAIT: action.Wait,
PROCESSXML: action.ProcessXml,
FILEACTION: action.FileAction,
FETCHCYCLEDETAIL: action.FetchCycleDetail,
HOVER: action.Hover
}

export interface ITestCase {
number: string,
category: string,
steps: string,
execute: boolean,
success?: boolean
}

export interface ITestRunner {
mappings: { [key: string]: any },
language: { [key: string]: any },
categories: { [key: string]: any },
testCases: ITestCase[]
}

class TestCaseBuilder implements ITestRunner {
mappings = null
categories = null
language = null
testCases = []

constructor(config: ITestRunner) {
    Object.assign(this, config);
}

start() {
    const { mappings, language } = this;
    fixture('HexaVue').page(mappings.URL)
        .beforeEach(async t => {
            await t.maximizeWindow(); // we can check this a first as well
            await new action.TypeText({
                testControl: t,
                options: {
                    mappings: mappings,
                    language: language,
                    category: 'Login',
                    action: 'TypeText',
                    data: `Username Field=${mappings.Username}`
                }
            }).execute();

            await new action.TypeText({
                testControl: t,
                options: {
                    mappings: mappings,
                    language: language,
                    category: 'Login',
                    action: 'TypeText',
                    data: `Password Field=${mappings.Password}`
                }
            }).execute();
            await new action.Click({
                testControl: t,
                options: {
                    mappings: mappings,
                    language: language,
                    category: 'Login',
                    action: 'click',
                    data: 'Sign In'
                }
            }).execute();
        
           r;

Your complete test report

  1. The specified selector does not match any element in the DOM tree.

    > | Selector('.col-sm-8:nth-child(1) .w-100:nth-child(3) .px-2')
    

    Browser: Chrome 129.0.0.0 / Windows 11

       6 |test('loginTest', async t => {
       7 |    await t
       8 |        .typeText(Selector('#user_session_login'), 'admin')
       9 |        .typeText(Selector('#user_session_password'), 'Admin123!@#')
      10 |        .click(Selector('#login'))
    > 11 |        .click(Selector('.col-sm-8:nth-child(1) .w-100:nth-child(3) .px-2'))
      12 |        .click(Selector('#menuPreOp'))
      13 |        .click(Selector('a').withText('EquipmentVue'));
      14 |});
      15 |
    
      at <anonymous> (C:\Test\Sample Test\logintest.ts:11:10)
      at <anonymous> (C:\Test\Sample Test\logintest.ts:8:71)
      at __awaiter (C:\Test\Sample Test\logintest.ts:4:12)
      at <anonymous> (C:\Test\Sample Test\logintest.ts:6:29)
    

1/1 failed (13s)

Screenshots

No response

Steps to Reproduce

  1. Enter User Name
    2.Enter Password
  2. Click login - Fails to click

TestCafe version

3.6

Node.js version

20.XXX

Command-line arguments

direct testcasebulilder file

Browser name(s) and version(s)

any

Platform(s) and version(s)

No response

Other

No response

@AmolForAll AmolForAll added the TYPE: bug The described behavior is considered as wrong (bug). label Oct 9, 2024
@testcafe-need-response-bot testcafe-need-response-bot bot added the STATE: Need response An issue that requires a response or attention from the team. label Oct 9, 2024
@Bayheck Bayheck added STATE: Need simple sample A simple sample is required to examine the issue. and removed STATE: Need response An issue that requires a response or attention from the team. labels Oct 14, 2024
Copy link

Thank you for submitting a bug report. We would love to help you investigate the issue. Please share a simple code example that reliably reproduces the bug. For more information, read the following article: How To Create a Minimal Working Example When You Submit an Issue. We look forward to your response.

@github-actions github-actions bot added the STATE: Need clarification An issue lacks information for further research. label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
STATE: Need clarification An issue lacks information for further research. STATE: Need simple sample A simple sample is required to examine the issue. TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
Development

No branches or pull requests

2 participants