ClickItem select another Option
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ClickItem select another Option
Hi all,
in a script test I'm trying to select a Select Option with the ClickItem function but TestComplete select the Option that is ten positions above the desired one.
The script portion is:
selectElement.scrollIntoView();
selectElement.clickItem(elementName);
The HTML code is
<select _ngcontent-yqp-c115="" class="form-select form-select-sm select-dark ng-pristine ng-valid ng-touched" id="id-3">
...
<option _ngcontent-yqp-c115="" id="idOpt-3-24" value="16: 24">
<span _ngcontent-yqp-c115="" class="select-option-dark">
Bahamas
</span>
</option>
...
<option _ngcontent-yqp-c115="" id="idOpt-3-34" value="26: 34">
<span _ngcontent-yqp-c115="" class="select-option-dark">
Bolivia
</span>
</option>
...
</select>
During the test execution the mouse pointer correctly select the Option desired but when the panel of the select is closed the item selected result the wrong item.
I do this two times in a script on two long Select and I have the same behaviour.
Why does this happen?
Thanks
Lorenzo
Solved! Go to Solution.
- Labels:
-
Script Tests
-
Test Run
-
Web Testing
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What version of TestComplete are you using?
The issue has been fixed in the latest version of TC v15.53.2.7. Also, see post https://community.smartbear.com/t5/TestComplete-Questions/Selecting-item-from-drop-down-list/m-p/253...
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@rraghvani wrote:What version of TestComplete are you using?
The issue has been fixed in the latest version of TC v15.53.2.7. Also, see post https://community.smartbear.com/t5/TestComplete-Questions/Selecting-item-from-drop-down-list/m-p/253...
I'm using Version: 15.45.31.7 x64
I'm afraid to update TestComplete because the last time I did it was a tragedy
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@lodecesa wrote:
@rraghvani wrote:What version of TestComplete are you using?
The issue has been fixed in the latest version of TC v15.53.2.7
I'm using Version: 15.45.31.7 x64
I have updated to the v15.53.2.7 but I have the same issue.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here's example code using website https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select
function SelectItem()
{
var page = Sys.Browser().Page("https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select").FindElement("#iframeResult");
var listbox = page.FindElement("//select[@id=(//label[.='Choose a car:']/@for)]");
listbox.ClickItem("Audi");
}
that correctly selects item Audi from the drop down list.
The only issue with ClickItem method, is that it iterates through all items - I've reported the issue, and hopefully it will be fixed in the next patch.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry but this not function for me, the drop down list have several items and ClickItem don't select the correct item.
I have several Dropdown lists in my page but TestComplete don't work correctly. Don't select the correct Item. I have setted some breakpoints, before execute the command I highlight the Dropdown affected by the command and TC highlight it correctly. When I execute the command (ClickItem) TC select the right Item but when the Dropdown is closed the item that is selected is the wrong one.
All this behavior is unacceptable
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Chrome 115 is out and it may be causing ClickItem issues again
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
The code and markup that you've provided look to be correct, so I would report a problem to Support via the https://support.smartbear.com/testcomplete/message/ form. Your case seems to be different from the behavior described by @rraghvani, but I am not excluding the possibility that they both have the same root. Thus you may mention rraghvani's case in your ticket as well.
/Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@jkrolczy wrote:
What browser are you using?
Chrome 115 is out and it may be causing ClickItem issues again
That was the problem!
Thanks
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I have updated my TC build (15.53.2.7) and Chrome is the latest version (115.0.5790.171) and ClickItem is not working. Any other suggestions?
