Skip to content

Sleep and Set selenium speed not working in For Loop #4072

Closed

Description

@prdpshrma255

Hi, when i am using For loop for list created using excel sheet. then i am getting all the elements using log to console. But i am unable to apply any delay. Tried both set selenium speed and Sleep functions. All the values are printed in just 1-2 seconds.

*** Settings ***
Library SeleniumLibrary
Library ../Resources/excel.py
Library Collections

*** Variables ***
${browser} chrome

*** Test Cases ***
market
@{list1}= GetListofShares
#set selenium speed 5
FOR ${i} IN ${list1}
LOG TO CONSOLE ${i}
#input text xpath://input[@list='stockSearch'] ${i}
sleep 20
END

Excel.py file:
import openpyxl

def GetListofShares():
wkb = openpyxl.load_workbook("C:/Users/Downloads/shares.xlsx")
sh = wkb["list"]
rows = sh.max_row
columns = sh.max_column
listednames = []
for i in range(2,rows+1):
listednames.append(sh.cell(i,2).value)
return listednames

Activity

  1. prdpshrma255 commented on Aug 29, 2021

    @prdpshrma255
    Author

    My bad. I should have used : FOR ${i} IN @{list1}

    Thanks. Closing the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions