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

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

Related

Flutter login i want to stop the loop

enter image description here
Login with google is working and logging in but this loop starts when i don't want to login how can i stop it.
It happens because you use RoundedLoadingButton package. But if you want to stop it when you have an error you can call googleController.stop();

Event should trigger when Toastr notification appears

i want to trigger an event using protractor for close the Toastr notification messages. whenever the notification appears this event should triggered.. is this possible??
I have 10 forms ,i am validating these forms using protractor. In each form i have editable text fields. If you add/edit/delete any fields you will get toastr notification message. I want to close these messge whenever it appears in my appliaction.
is this possible?? Thanks in advance..
You can execute JS code while running your test for closing toastr notification, you could try this one (I tested it in their demo project - run this code toastr.remove() in a console when toastr notification was shown):
await browser.executeScript(toastr.remove())
note that browser.executeScript() return Promise so you need to resolve it.

E2E test Protractor issue: redirect to another page in the same window

The website I need to test requires login. However, you have to stay in the same window to keep your login information, which means if you close the window of this page, you need to login again. This gives me the problem: when I am using protractor to test the websites, it seems like each time I use browser.get(url). It will turn off the browser and open another one for the test, then I lost my login information. So I can't test the pages I want to test. Can anybody give me some suggestions, I have not figured it out for one days. Crazy!
describe('Sample List page test', function(){
beforeEach(function(){
browser.driver.get('http://localhost:8600/#/login');
browser.driver.sleep(2000);
browser.driver.findElement(by.id('google-login')).click();
});
it('should list all the items in samples',function(){
browser.get("#/osctr/sample");
expect(browser.getTitle()).toBe("Sample");
}
});
});
In the above codes, I can't get information in the sample page because I used brower.get(url), it will open a new page which I will lose my login information.
When you do browser.driver.get(), it would open a new windown. That's how selenium-webdriver works. There was an issue opened longtime back to attach webdriver instance to an existing browser window which is now marked as NotFeasible.
If you want to keep the browser session intact, you can do browser.driver.get() in before() method instead of beforeEach() and have multiple tests that work on the same browser instance and quit the browser in after method.

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.

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

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