mcdcorp / opentest

Open source test automation tool for web applications, mobile apps and APIs
https://getopentest.org
MIT License
451 stars 108 forks source link

Test syntax issue #343

Closed muzammilhashmii closed 3 years ago

muzammilhashmii commented 4 years ago

I'm new to this tool. this issue might b silly but I'm facing an issue during creating new test file. When I write following steps

" description: Navigate to Centegy Web App

actors:
    actor: ACTOR1 segments:
        segment: 1
        actions:
            description: Navigate to Centegy Web App
            action: org.getopentest.selenium.NavigateTo
            args:
            url: http://10.1.111.6:8080/CBI/login "

the test file runs successfully, but whenever i add these below written steps in my test file it get hid from create session test list.

" description: Navigate to Centegy Web App actors:

actor: ACTOR1 segments:
    segment: 1 actions:
        description: Navigate to Centegy Web App
        action: org.getopentest.selenium.NavigateTo - args:

            url: http://10.1.111.6:8080/CBI/login

            description: Enter User ID -action: org.getopentest.selenium.SendKeys -args:

            locator: {css: "input[name='username']"}

            text: shma000

            sendEnter: true

            description: Enter Password - action: org.getopentest.selenium.SendKeys - args:

            locator: {css: "input[id='a4']"}

            text: abc123

            sendEnter: true "

this might be syntax issue .can anyone help me out ?

adrianth commented 4 years ago

This issue is due to the fact that you have syntax errors in your YAML. Here's how it should look like (please note this is untested code):

description: Navigate to Centegy Web App actors
actors:
- actor: ACTOR1
  segments:
    segment: 1
    actions:
      - description: Navigate to Centegy Web App
        action: org.getopentest.selenium.NavigateTo
        args:
          url: http://10.1.111.6:8080/CBI/login

      - description: Enter User ID
        action: org.getopentest.selenium.SendKeys
        args:
          locator: {css: "input[name='username']"}
          text: shma000

      - description: Enter Password
        action: org.getopentest.selenium.SendKeys
        args:
          locator: {css: "input[id='a4']"}
          text: abc123
          sendEnter: true

To make it easier to deal with these type of problems in the future:

muzammilhashmii commented 4 years ago

Still facing same issue. this is he html of my page

<style type="text/css">
    .client_spec {
        position: fixed;
        left: 0;
        right: 0;
        background: url(/CBI/css/partial/image/loreal2.jpg) repeat-y;
        background-size: cover;

    }
</style>
CENTEGY TECHNOLOGIES
Application v.2.0
Invalid username and password.

USER LOGIN

Incase of lost password, please use password recovery

Proudly Powered By Centegy Technologies
All intellectual property rights, reserved to Centegy Technologies.

muzammilhashmii commented 4 years ago

according to this html, for the time being i just wanted to login to the page and test it. Am I doing the right thing or missing some steps ?

muzammilhashmii commented 4 years ago

I'm writing this YAML

description: Navigate to Centegy Web App
actors:
- actor: ACTOR1
  segments:
    segment: 1
    actions:
      - description: Navigate to Centegy Web App
        action: org.getopentest.selenium.NavigateTo
        args:
          url: http://10.1.111.6:8080/CBI/login

      - description: Enter User ID
        action: org.getopentest.selenium.SendKeys
        args:
          locator: {css: "input[name='username']"}
          text: shma000

      - description: Enter Password
        action: org.getopentest.selenium.SendKeys
        args:
          locator: {css: "input[id='a4']"}
          text: abc123
          sendEnter: true

          - description: Click the Log in button in the login form
            action: org.getopentest.selenium.Click
            args:
              locator: { css: input"button.btn" }
muzammilhashmii commented 4 years ago

image

muzammilhashmii commented 4 years ago

image

muzammilhashmii commented 4 years ago

still this yaml file is not showing in created test

muzammilhashmii commented 4 years ago

Your help would be really appreciated

adrianth commented 4 years ago

The test syntax as you provided it a couple of comments ago is still incorrect. The last four lines (the ones that describe the very last test action) are not properly aligned - you need to move them to the left (use Shift+Tab) to align with the rest of the actions, otherwise your YAML will be invalid. Please install the "YAML Language Support by Red Hat" extension in VS Code, so it's easier to catch invalid YAML.

muzammilhashmii commented 4 years ago

is there any test screen UI recorder (like selenium IED) for web and andriod which is compatible with opentest to generate automatic yaml? and which key can be used to launch an android app in opentest like we use nevigate to for web.

muzammilhashmii commented 4 years ago

image

for android I've used these things in actor file what should be the name of automation?

muzammilhashmii commented 4 years ago

image

For launching App I've used this. is this correct?

muzammilhashmii commented 4 years ago

Thank you so much for this extension , I've created test cases just wanted to know about automated UI Script generator if you can recommend for web and android both

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.