cancel
Showing results for 
Search instead for 
Did you mean: 

When a checkbox is checked/unchecked in Test Complete it logs error

SOLVED
Highlighted
Contributor

When a checkbox is checked/unchecked in Test Complete it logs error

I am using below code to check/uncheck a checkbox. The checkbox in application is sucessfully checked/unchecked, but i am getting following error in log "The tree node's '[0]' state image was clicked, but the node stayed in the unchecked state."

 

Below is the code 

pmAfxWnd.page32770.pageFeature.TreeViewFeature.wItems.Item(0).Check(cbChecked)

 

Same is observed when uncheck the checkbox

 

Any help is appricated.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Manager

Re: When a checkbox is checked/unchecked in Test Complete it logs error

Hi @rushikesh,

 

I assume the check action is associated with an event handler in your app and the event in question does not fire in your case. In such situations, it's usually a good idea to try to simulate a mouse click or a spacebar keystroke over the object to make sure the action simulated by TestComplete is as close to real-life user interaction as possible.

 

In your script, you use Check(cbChecked) action. According to this article, this action moves the mouse pointer to the item and set its value. However, TestComplete doesn't click it.

 

Since you need to trigger the event handler, I recommend that you use just a single action (without wState assignment) to interact with the checkbox. The action can be any of the following:

...ClickChecked(false)  
...Click() // this assumes the checkbox is not in the needed state
...Keys(" ") // this assumes the checkbox is not in the needed state

Does it help?

---------
Tanya Gorbunova
SmartBear Community Manager

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today

View solution in original post

4 REPLIES 4
Highlighted
Community Hero

Re: When a checkbox is checked/unchecked in Test Complete it logs error

Possibly a timing issue... that the box is not ready to be operated on immediately.  If there's background processing still in progress that would do it.  Could be something with expanding the tree... maybe it needs to be expanded first before you can check the box.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Community Manager

Re: When a checkbox is checked/unchecked in Test Complete it logs error

Hi @rushikesh,

 

I assume the check action is associated with an event handler in your app and the event in question does not fire in your case. In such situations, it's usually a good idea to try to simulate a mouse click or a spacebar keystroke over the object to make sure the action simulated by TestComplete is as close to real-life user interaction as possible.

 

In your script, you use Check(cbChecked) action. According to this article, this action moves the mouse pointer to the item and set its value. However, TestComplete doesn't click it.

 

Since you need to trigger the event handler, I recommend that you use just a single action (without wState assignment) to interact with the checkbox. The action can be any of the following:

...ClickChecked(false)  
...Click() // this assumes the checkbox is not in the needed state
...Keys(" ") // this assumes the checkbox is not in the needed state

Does it help?

---------
Tanya Gorbunova
SmartBear Community Manager

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today

View solution in original post

Highlighted
Contributor

Re: When a checkbox is checked/unchecked in Test Complete it logs error

@TanyaGorbunova  

a spacebar keystroke over the object got it throught.

 

Thank you 🙂

 

Regards,

Rushikesh Kadam

Highlighted
Community Manager

Re: When a checkbox is checked/unchecked in Test Complete it logs error

Great! Happy to help 🙂

---------
Tanya Gorbunova
SmartBear Community Manager

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!

Challenge Status

How to execute remote test and obtain results via Test Runner REST API

Participate!

Comparing content of HTML table with Excel file data

Participate!

Compare HTML table with Excel file and correct data in the file

Participate!

Retrieve Data from a Web Page

Participate!