How to perform action using Excel data in TestComplete with Python
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to perform action using Excel data in TestComplete with Python
Greetings,
As i am new to Python and Python with TestComplete. Can anyone please explain how to handle this?
Scenario:
I am storing "ControlID", "Type", "Action", "Data" in my excel sheet.
I need to find the ControlID from one python class and from the other class i need to perform actions based on controlID
ex:
class Common():
def FindCtrlID():
Find the controlID from Excel
class test():
def Navigate_Str():
Find the control ID from Common Class
if type==button & Action==Click
CtrlId.click()
elif type==textbox & Action==Sendkeys
CtrlID.Sendkeys(Data from Excel)
NOTE: Excel file is attached
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm not python script-er but as far as i know if you declare the variable as Global then you will able find the value from one class to another.
Like blow in your code:
class Common(): def FindCtrlID(): global controlID = "find from excel sheet" class test(): def Navigate_Str(): Find the control ID from Common Class Log.Message(controlID) if type==button & Action==Click CtrlId.click() elif type==textbox & Action==Sendkeys CtrlID.Sendkeys(Data from Excel)
For getting values from Excel you ca refer here https://support.smartbear.com/testcomplete/docs/testing-with/data-driven/drivers.html
Thanks
Shankar R
LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com
“You must expect great things from you, before you can do them”- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
