While recording the script, scripts records the command like "click id=ui-id-25" - selenium-ide

I am recording the site of online ticket booking and while recording the script, scripts records the command like "click id=ui-id-25". Once I finish recording the script and click on play to run current test case. I get error message like 'Element id=ui-id-25 not found'.
So please let me know what's the meaning of the command 'click id=ui-id-25' and why its recorded, even though while running the script we get error message.

The meaning of the command
The command click id=someId tells Selenium to simulate the click on the element on the page which has id = "someId". If there is no element with this id on the page at the time of execution of this command; we have the error telling that Element ... not found !.
Why it's recorded
Selenium IDE records actions you do in the page. Clicking an element of the page is an action so it's recorded.
Why we get this error
This is actually because Selenium IDE doesn't record "waiting time". If, while recording, you do action 1 and wait for an element to be shown (even for 0.5 second) and then click on this element. For Selenium, this is only two actions :
doing action 1
clicking the element
and so when running the test case, it try to click the element directly after doing the action 1 without waiting. In this case, it doesn't find the element and gives the error !
Okey, what is the solution ?
One simple solution is to add the command waitForElementPresent to wait for the element to be present on the page before clicking it. You can do that while recording the test case right click on the element and selecting this command before clicking on it. Or you can add it to the test case when seeing this error. Add it just before the click command causing the error and give it the same argument as the click ( ie. id = ui-id-25 in your case)
Hope this answers your questions

Related

Couldn't perform click, button not found in: 'click on "OBFormFieldSelectInputRequired"'

Recently, I registered with Testrigor and am using its Free version. We need to test dynamic web applications in Testrigor, then we write scripts for the same. In our Application 3 field use same class selector ,so when i used class in script for enter value in that class but that time Test rigor entered value in another field because of same class,i was try to resolve issue using Name And id Locator but Issue not Solved.
I am getting the following error in one field .
Couldn't perform click, button not found in: 'click on "OBFormFieldSelectInputRequired"'.
Please check attached screenshot.
I'm Tried with Name And Id locator

Google Smart Home action responds "[Service] is not available right now" after the action completed succesfully

My Google SmartHome action is giving an error message "[Service] cannot be reached right now" after having executed the command properly. My device is properly switched on / off, but Google ends with that annoying message.
The input I get from Google:
{"inputs":[{"context":{"locale_country":"NL","locale_language":"nl"},"intent":"action.devices.EXECUTE","payload":{"commands":[{"devices":[{"id":"6"}],"execution":[{"command":"action.devices.commands.OnOff","params":{"on":true}}]}]}}],"requestId":"1389468583286354563"}
The response I give back:
{"requestId":"1389468583286354563","payload":{"commands":[{"ids":["6"],"status":"SUCCESS","states":{"on":true,"online":true}}]}}
Function execution took 2287 ms, finished with status code: 200
Next, I already (async) report state:
{"requestId":"1389468583286354563","agentUserId":"f0524769-7ffb-4ae4-8cec-5d67e6f6aa92","payload":{"devices":{"states":{"6":{"on":true,"online":true}}}}}
The report state API gives back that that was successfull.
I have no clue why Google gets back (even though the action is carried out successfully) that they cannot reach our service?
Thanks to #Devunwired: I overlooked the Google Assistant Action logs. In it, it said the function is returning an empty JSON response. It turned out that the return statement was 1 parenthesis too early, causing the async function to return an empty value.

click_no_wait and then execute_script

I'm using the page object gem with a page that contains a link.
When the link is clicked, the browser navigates to a new page, and the HTML renders as expected.
However, my script is always returning a Timeout::Error: Timeout::Error. After looking at the browser network activity, I noticed a pattern with a long running get that never completes.
If I run the script and then go to the console and issue the command
$.connection.hub.stop(), the script will not time out.
Is there a way to perform a click_no_wait or to click and then execute a script via the use of page_object_gem ?
Here is my page-object attempt, but it is resulting in a timeout still.
class MyThing
include PageObject
include PageObject::PageFactory
link(:show_details, :id => 'detailLink')
def click_show_details_no_wait
begin
show_details_element.click
rescue Exception => e
execute_script('$.connection.hub.stop();')
end
end
end
It is hard to suggest without your page. My first idea is to try to do
show_details_element.fire_event('click')
instead of a usual click.
The second idea is take a look at
Stop loading page watir-webdriver
Is there have method to stop page loading in watir-webdriver
how to click on browser “stop loading this page” using ruby watir?
Good luck.

Appium+android+selenium switch

I have login scenario in which when the user click on the signin button then the next activity is opened in which there is a list. i am new to appium and find it hard how to get the validation that the login is successfull.
I didnt got success with the below
driver.switchTo().window((String)driver.getWindowHandles().toArray()[windowIndex]);
please guide how to get the current activity & move to awaiting activity, so that i can validate the object existance.
Can you just share the screenshot of the next activity and while launching your apk file with the starting activity name , there is no further need to specify the next activity names. Appium will run the next concurrent activitiesby itself.

How can i generate a message in selenium IDE for user to do a particular action?

when i play my test script then it stops at a page. Is there any command to generate a message to the user to click on the button to proceed to the next page.
you can display you message in an alert window
command:open
Target:/
command:click
target:btnAlert
command:assertAlert
target:I’m blocking!
command:verifyTextPresent
target:Alert is gone.
then continue rest of your test cases