Hello,
I’m using the JQWidget framework and I can’t select a value from a dropdownlist present in an array. Here is the link to the table: XB jqxGrid test - JavaScript Editor.
Thanks for your help!
Kabylian
Hello,
I’m using the JQWidget framework and I can’t select a value from a dropdownlist present in an array. Here is the link to the table: XB jqxGrid test - JavaScript Editor.
Thanks for your help!
Kabylian
I’m not sure if I’m going to be helpful, but I went to your test site and put in your xpath and it didn’t find anything. I also didn’t see any dropdown list either. However, I tried the below and it finds “Ship City”, which maybe what you can use as a trial.
id("columntablejqxgrid")/div[1]/div[1]/div[1]/span
or
//*[@id="columntablejqxgrid"]/div[1]/div[1]/div[1]/span
Hello grylion54,
I am using Katalon Recorder and the element : id(“columntablejqxgrid”)/div[1]/div[1]/span is not recognized.
The dropdown list appears when you click twice on the first cell.
In my scenario, I want to be able to drop down the list.
Thanks.
Kabylian
Wow. Yeah, the instructions are kind of important. Do you get the dropdown arrow to display?
If you do, perhaps you should just put in a pause, wait or delay before and after you click on it to give time for your page to set up.
Hello grylion54,
The dropdown arrow is not displayed.
Manually, you have to click twice on the cell to make the dropdown list appear. I The dropdown list does not appear when I simulate the click in Katalon Recorder.
Best Regards
Kabylian
I was able to put a script together in Katalon Studio to get the dropdown list to show. What I found was that your click on the cell to display the dropdown is one step above the div that I clicked upon.
cell xpath = 'id("row0jqxgrid")/div[1]/div[1]'
Can you try that to see if that solves your concern?
I just put this here so you can see the pathways that I used to get the dropdown to display.
WebUI.openBrowser('https://jseditor.io/?key=xb-jqxgrid-test')
// like it better when see all the items
WebUI.maximizeWindow()
WebUI.waitForPageLoad(10)
WebDriver driver = DriverFactory.getWebDriver()
"start the test run"
pItem = driver.findElement(By.xpath('id("runTxt")'))
pItem.click();
WebUI.delay(2)
"take account of the iframe"
TestObject tObj = new TestObject('id("contentFrame")')
tObj.addProperty("xpath", ConditionType.EQUALS, 'id("contentFrame")')
WebUI.switchToFrame(tObj, 10)
"add a row to the table"
pItem = driver.findElement(By.xpath('id("addRow")'))
pItem.click();
WebUI.delay(2)
"click on the cell the first time"
pItem = driver.findElement(By.xpath('id("row0jqxgrid")/div[1]/div[1]'))
pItem.click();
WebUI.delay(1)
"click on the cell the second time"
pItem = driver.findElement(By.xpath('id("row0jqxgrid")/div[1]/div[1]'))
pItem.click();
WebUI.delay(1)
"check if we have the dropdown arrow in our pathway"
pItem = driver.findElement(By.xpath('id("dropdownlistArrowcomboboxeditorjqxgridShipCity")/div[1]'))
WebUI.verifyMatch(pItem.isDisplayed().toString(), "true", false)
WebUI.verifyMatch(pItem.isEnabled().toString(), "true", false)
pItem.click();
WebUI.delay(4)
"I think the dropdown has dynamic ids; select items from the dropdown"
pItem = driver.findElement(By.xpath('//div[contains(@id, "innerListBoxjqxWidget")]/div[1]/div[3]/span'))
pItem.click();
WebUI.delay(2)
pItem = driver.findElement(By.xpath('id("dropdownlistArrowcomboboxeditorjqxgridShipCity")/div[1]'))
pItem.click();
WebUI.delay(2)
pItem = driver.findElement(By.xpath('//div[contains(@id, "innerListBoxjqxWidget")]/div[1]/div[2]/span'))
pItem.click();
WebUI.delay(2)
pItem = driver.findElement(By.xpath('id("dropdownlistArrowcomboboxeditorjqxgridShipCity")/div[1]'))
pItem.click();
WebUI.delay(2)
pItem = driver.findElement(By.xpath('//div[contains(@id, "innerListBoxjqxWidget")]/div[1]/div[1]/span'))
pItem.click();
WebUI.delay(2)
Hello grylion54,
xpath=//div[@id=‘row0jqxgrid’]/div[1]/div[1] runs without error but nothing happens in the browser. The dropdown list does not appear after clicking twice.
Best Regards,
Kabylian
If you take a look at my “Studio Code” above, I insert lots of delays in my code. Katalon Recorder has the “pause” statement and “waitForElementPresent” statement. I suggest you use them.
Try to insert some time delays to allow the page to set up. Your script is probably running faster than the web page is. I was not only able to get the dropdown list to appear, but to select each item one after the other.
Edit: Just a note that the delay command is based upon seconds, whereas I believe the pause command is based upon milliseconds; so, 1000 milliseconds make 1 second.
Hi grylion54,
The problem is not the delay because in Katalon Recorder I have set the execution speed slowly. The row must be in edit mode to be able to see the dropdown list. So I used the runScript command and the javascript code: $(“#jqxgrid”).jqxGrid(‘beginrowedit’, 0);
Now the dropdown list is displayed and I can click on it.
Thanks a lot for your help
Best Regards
Kabylian
Hi,
I would like to know why the code below works on Selenium IDE and not on Katalon Recorder?
Selenium IDE
Katalon Recorder
Best Regards,
Kabylian
You should just ask why it doesn’t work in Katalon Recorder. No need to talk about other products.
How about inserting “wait for element present for xxx seconds” above “click” commands.
It is a good exercise to make sure that the target elements are present before every clicks.
Hi kazurayam,
Sorry for quoting another product.
The waitForElementPresent command does not change anything. Besides i adjust play speed slowly.
Best Regards,
Kabylian.
I’m not sure what is going on but your Log is showing that it cannot find:
xpath=//div[2]/div/div/div/div/div[2]
and your code has red highlight on:
xpath=//div[@id='...']/div
Definitely not the same pathway.
Maybe you should restart Katalon Recorder and try again.
Hi grylion54,
I have restarted Katalon Recorder. It doesn’t change anything.
Thank you.
Kabylian
You have to account for the <iframe>
in the grid, so does selectFrame
and index=0
do that? Maybe index=1
?
It’s not that because I can click on the Add button in the Iframe.
That’s good.
The next two lines of Clicks are using xpath=//div[@id("row0jqxgrid"]/div
but in my “Studio Code” routine above I found the pathway to be xpath=id("row0jqxgrid")/div[1]/div[1]
or xpath=//div[@id("row0jqxgrid"]/div[1]/div[1]
.
Perhaps you can try that next?