Need help with code please! :)

Hi I am new to rpa, and coding but i have tried many times but fail and need help
opening multiple urls, I need help with searching for login pages in urls… for e.g searching element or
sourcesearch? Can someone help? With detecting login pages…

I have to do the following is to -

  1. ReadCSV
  2. echo when read
  3. Open (Col)
  4. Search for element (could be form, login?)
  5. Take screenshot of the login webpage
  6. Store the login pages url in csv.

Can someone please help me? Much appreciated…

{
“Name”: “new”,
“CreationDate”: “2020-8-18”,
“Commands”: [
{
“Command”: “csvRead”,
“Target”: “testing.csv”,
“Value”: “”
},
{
“Command”: “echo”,
“Target”: “Status = {!csvReadStatus}, line = {!csvReadLineNumber}”,
“Value”: “”
},
{
“Command”: “open”,
“Target”: “${!COL1}”,
“Value”: “”
},
{
“Command”: “waitForPageToLoad”,
“Target”: “3000”,
“Value”: “”
},
{
“Command”: “sourceSearch”,
“Target”: “form”,
“Value”: “”
},
{
“Command”: “click”,
“Target”: “link=Open one new browser window”,
“Value”: “”
},
{
“Command”: “selectWindow”,
“Target”: “tab=1”,
“Value”: “”
}

Hi

Add csv content please and give more details about this command

{
“Command”: “sourceSearch”,
“Target”: “form”,
“Value”: “”
},
{
“Command”: “click”,
“Target”: “link=Open one new browser window”,
“Value”: “”
},

Usually is not a good idea open new tab in browser can create difficulty to selectWindow command.

Add more details and url of sites to open please

1 Like

Hi newuserkantu,

I am having some issues with select window and TAB=OPEN
It always open with link :chrome-extension://gcbalfbdmfiec

Also same issue when i try Command: Open

And then the page says the file is not found:

Why is this so?

I just want to open the urls in csv smoothly…

Thank you for the reply, I did some changes just now before:

{
“Name”: “new”,
“CreationDate”: “2020-8-18”,
“Commands”: [
{
“Command”: “store”,
“Target”: “fast”,
“Value”: “!replayspeed”
},
{
“Command”: “csvRead”,
“Target”: “testing.csv”,
“Value”: “”
},
{
“Command”: “echo”,
“Target”: “Status = ${!csvReadStatus}, line = ${!csvReadLineNumber}”,
“Value”: “”
},
{
“Command”: “selectWindow”,
“Target”: “TAB=OPEN”,
“Value”: “${!COL1}”
},
{
“Command”: “setWindowSize”,
“Target”: “1024x768”,
“Value”: “”
},
{
“Command”: “waitForPageToLoad”,
“Target”: “3000”,
“Value”: “”
},
{
“Command”: “verifyText”,
“Target”: “xpath=//[@id="login"]/div/div/div/div/div/div/div[2]/div/form/div/div/input",
“Value”: “”,
“Targets”: [
"xpath=//
[@id="login"]/div/div/div/div/div/div/div[2]/div/form/div/div/input”,
“xpath=//input[@type=‘text’]”,
“xpath=//input”,
“css=#login > div > div > div > div > div.col-sm-4 > div > div.card-body > div > form > div:nth-child(1) > div > input”
]
},
{
“Command”: “if_v2”,
“Target”: “${!statusOK} == true”,
“Value”: “”
},
{
“Command”: “captureScreenshot”,
“Target”: “new”,
“Value”: “”
},
{
“Command”: “csvSave”,
“Target”: “”,
“Value”: “”
},
{
“Command”: “end”,
“Target”: “”,
“Value”: “”
}
]
}

Some example links:
https://mail.marketing.pgbank.com.vn/

Objective is to detect login pages, any ideas?

There are more solution to do this the easy is check the url to detect if is an internal page after login or a guest page.

You can use to a simple click on logout button, if fails you are not logged.

Here the code

 {
      "Command": "executeScript",
      "Target": "return (window.location.href)",
      "Value": "u"
    },
    {
      "Command": "if_v2",
      "Target": "${u}.includes (\"loginurl\") == true",
      "Value": ""
    },
    {
      "Command": "echo",
      "Target": "COMMAND AFTER LOGIN",
      "Value": "#shownotification"
    },
    {
      "Command": "end",
      "Target": "",
      "Value": ""
    },