简体   繁体   中英

Not able to navigate to the page after clicking button

I'm not able to navigate to a different page after clicking on the button.

My Script tells it is clicking on the button and the script is pass even though on UI it doesn't navigate to the different page and remains on the same page.

Below is my code

Navigate to Inspection Services
    click element    ${link_inspectionservices}

    wait until element is visible  ${link_homeinspection}

    set browser implicit wait    10

    wait until element is visible  ${link_homeinspection}

    click element    ${link_homeinspection}

this script is a pass. But actually, it is not navigating to the home inspection page.

I don't know which UI framework you are testing. In some javascript frameworks the normal "Click element" KW doesn't work always.

Try this one:

wait until element is visible  ${link_homeinspection}

set browser implicit wait    10

wait until element is visible  ${link_homeinspection}
${elem}  Get WebElement  ${link_homeinspection}
Execute Javascript  arguments[0].click();  ARGUMENTS  ${elem}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM