Ask a Question

How to perform action using Excel data in TestComplete with Python

Rajesh2
Contributor

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

2 REPLIES 2
shankar_r
Community Hero

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”

Extension Available

Hi @baxatob Can you Please help me with this one?

cancel
Showing results for 
Search instead for 
Did you mean: